<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span id="local-6989586621680802922"><span id="local-6989586621680802923"><span id="local-6989586621680802924"><span id="local-6989586621680802925"></span></span></span></span><span class="hs-comment">{-
(c) Bartosz Nitka, Facebook, 2015

UniqDFM: Specialised deterministic finite maps, for things with @Uniques@.

Basically, the things need to be in class @Uniquable@, and we use the
@getUnique@ method to grab their @Uniques@.

This is very similar to @UniqFM@, the major difference being that the order of
folding is not dependent on @Unique@ ordering, giving determinism.
Currently the ordering is determined by insertion order.

See Note [Unique Determinism] in GHC.Types.Unique for explanation why @Unique@ ordering
is not deterministic.
-}</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-pragma">{-# LANGUAGE DeriveDataTypeable #-}</span><span>
</span><span id="line-18"></span><span class="hs-pragma">{-# LANGUAGE DeriveFunctor #-}</span><span>
</span><span id="line-19"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-20"></span><span class="hs-pragma">{-# LANGUAGE TupleSections #-}</span><span>
</span><span id="line-21"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wall #-}</span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Types.Unique.DFM</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-24"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Unique-keyed deterministic mappings</span></span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier">UniqDFM</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- abstract type</span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Manipulating those mappings</span></span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#emptyUDFM"><span class="hs-identifier">emptyUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#unitUDFM"><span class="hs-identifier">unitUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#addToUDFM"><span class="hs-identifier">addToUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#addToUDFM_C"><span class="hs-identifier">addToUDFM_C</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#addToUDFM_C_Directly"><span class="hs-identifier">addToUDFM_C_Directly</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#addToUDFM_Directly"><span class="hs-identifier">addToUDFM_Directly</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#addListToUDFM"><span class="hs-identifier">addListToUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#delFromUDFM"><span class="hs-identifier">delFromUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#delListFromUDFM"><span class="hs-identifier">delListFromUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#adjustUDFM"><span class="hs-identifier">adjustUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#adjustUDFM_Directly"><span class="hs-identifier">adjustUDFM_Directly</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#alterUDFM"><span class="hs-identifier">alterUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#mapUDFM"><span class="hs-identifier">mapUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#plusUDFM"><span class="hs-identifier">plusUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#plusUDFM_C"><span class="hs-identifier">plusUDFM_C</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#lookupUDFM"><span class="hs-identifier">lookupUDFM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#lookupUDFM_Directly"><span class="hs-identifier">lookupUDFM_Directly</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#elemUDFM"><span class="hs-identifier">elemUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#foldUDFM"><span class="hs-identifier">foldUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#eltsUDFM"><span class="hs-identifier">eltsUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#filterUDFM"><span class="hs-identifier">filterUDFM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#filterUDFM_Directly"><span class="hs-identifier">filterUDFM_Directly</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#isNullUDFM"><span class="hs-identifier">isNullUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#sizeUDFM"><span class="hs-identifier">sizeUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#intersectUDFM"><span class="hs-identifier">intersectUDFM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#udfmIntersectUFM"><span class="hs-identifier">udfmIntersectUFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#disjointUDFM"><span class="hs-identifier">disjointUDFM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#disjointUdfmUfm"><span class="hs-identifier">disjointUdfmUfm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-52"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#equalKeysUDFM"><span class="hs-identifier">equalKeysUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-53"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#minusUDFM"><span class="hs-identifier">minusUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#listToUDFM"><span class="hs-identifier">listToUDFM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#listToUDFM_Directly"><span class="hs-identifier">listToUDFM_Directly</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#udfmMinusUFM"><span class="hs-identifier">udfmMinusUFM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#ufmMinusUDFM"><span class="hs-identifier">ufmMinusUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#partitionUDFM"><span class="hs-identifier">partitionUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#anyUDFM"><span class="hs-identifier">anyUDFM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#allUDFM"><span class="hs-identifier">allUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-58"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#pprUniqDFM"><span class="hs-identifier">pprUniqDFM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#pprUDFM"><span class="hs-identifier">pprUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#udfmToList"><span class="hs-identifier">udfmToList</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-61"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#udfmToUfm"><span class="hs-identifier">udfmToUfm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-62"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#nonDetStrictFoldUDFM"><span class="hs-identifier">nonDetStrictFoldUDFM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-63"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#unsafeCastUDFMKey"><span class="hs-identifier">unsafeCastUDFMKey</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-64"></span><span>        </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#alwaysUnsafeUfmToUdfm"><span class="hs-identifier">alwaysUnsafeUfmToUdfm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-65"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html"><span class="hs-identifier">GHC.Types.Unique</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier">Uniquable</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier">Unique</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#getKey"><span class="hs-identifier">getKey</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntMap.html#"><span class="hs-identifier">Data.IntMap</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">M</span></span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#"><span class="hs-identifier">Data.Data</span></a></span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#"><span class="hs-identifier">Data.Functor.Classes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Eq1"><span class="hs-identifier">Eq1</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.OldList.html#sortBy"><span class="hs-identifier">sortBy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Function.html#"><span class="hs-identifier">Data.Function</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Function.html#on"><span class="hs-identifier">on</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.html#"><span class="hs-identifier">Data.Semigroup</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Semi</span></span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html"><span class="hs-identifier">GHC.Types.Unique.FM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier">UniqFM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html#nonDetUFMToList"><span class="hs-identifier">nonDetUFMToList</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html#ufmToIntMap"><span class="hs-identifier">ufmToIntMap</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html#unsafeIntMapToUFM"><span class="hs-identifier">unsafeIntMapToUFM</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-79"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Unsafe.Coerce.html#"><span class="hs-identifier">Unsafe.Coerce</span></a></span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="hs-comment">-- Note [Deterministic UniqFM]</span><span>
</span><span id="line-82"></span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-83"></span><span class="hs-comment">-- A @UniqDFM@ is just like @UniqFM@ with the following additional</span><span>
</span><span id="line-84"></span><span class="hs-comment">-- property: the function `udfmToList` returns the elements in some</span><span>
</span><span id="line-85"></span><span class="hs-comment">-- deterministic order not depending on the Unique key for those elements.</span><span>
</span><span id="line-86"></span><span class="hs-comment">--</span><span>
</span><span id="line-87"></span><span class="hs-comment">-- If the client of the map performs operations on the map in deterministic</span><span>
</span><span id="line-88"></span><span class="hs-comment">-- order then `udfmToList` returns them in deterministic order.</span><span>
</span><span id="line-89"></span><span class="hs-comment">--</span><span>
</span><span id="line-90"></span><span class="hs-comment">-- There is an implementation cost: each element is given a serial number</span><span>
</span><span id="line-91"></span><span class="hs-comment">-- as it is added, and `udfmToList` sorts it's result by this serial</span><span>
</span><span id="line-92"></span><span class="hs-comment">-- number. So you should only use `UniqDFM` if you need the deterministic</span><span>
</span><span id="line-93"></span><span class="hs-comment">-- property.</span><span>
</span><span id="line-94"></span><span class="hs-comment">--</span><span>
</span><span id="line-95"></span><span class="hs-comment">-- `foldUDFM` also preserves determinism.</span><span>
</span><span id="line-96"></span><span class="hs-comment">--</span><span>
</span><span id="line-97"></span><span class="hs-comment">-- Normal @UniqFM@ when you turn it into a list will use</span><span>
</span><span id="line-98"></span><span class="hs-comment">-- Data.IntMap.toList function that returns the elements in the order of</span><span>
</span><span id="line-99"></span><span class="hs-comment">-- the keys. The keys in @UniqFM@ are always @Uniques@, so you end up with</span><span>
</span><span id="line-100"></span><span class="hs-comment">-- with a list ordered by @Uniques@.</span><span>
</span><span id="line-101"></span><span class="hs-comment">-- The order of @Uniques@ is known to be not stable across rebuilds.</span><span>
</span><span id="line-102"></span><span class="hs-comment">-- See Note [Unique Determinism] in GHC.Types.Unique.</span><span>
</span><span id="line-103"></span><span class="hs-comment">--</span><span>
</span><span id="line-104"></span><span class="hs-comment">--</span><span>
</span><span id="line-105"></span><span class="hs-comment">-- There's more than one way to implement this. The implementation here tags</span><span>
</span><span id="line-106"></span><span class="hs-comment">-- every value with the insertion time that can later be used to sort the</span><span>
</span><span id="line-107"></span><span class="hs-comment">-- values when asked to convert to a list.</span><span>
</span><span id="line-108"></span><span class="hs-comment">--</span><span>
</span><span id="line-109"></span><span class="hs-comment">-- An alternative would be to have</span><span>
</span><span id="line-110"></span><span class="hs-comment">--</span><span>
</span><span id="line-111"></span><span class="hs-comment">--   data UniqDFM ele = UDFM (M.IntMap ele) [ele]</span><span>
</span><span id="line-112"></span><span class="hs-comment">--</span><span>
</span><span id="line-113"></span><span class="hs-comment">-- where the list determines the order. This makes deletion tricky as we'd</span><span>
</span><span id="line-114"></span><span class="hs-comment">-- only accumulate elements in that list, but makes merging easier as you</span><span>
</span><span id="line-115"></span><span class="hs-comment">-- can just merge both structures independently.</span><span>
</span><span id="line-116"></span><span class="hs-comment">-- Deletion can probably be done in amortized fashion when the size of the</span><span>
</span><span id="line-117"></span><span class="hs-comment">-- list is twice the size of the set.</span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span class="hs-comment">-- | A type of values tagged with insertion time</span><span>
</span><span id="line-120"></span><span class="hs-keyword">data</span><span> </span><span id="TaggedVal"><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-var">TaggedVal</span></a></span></span><span> </span><span id="local-6989586621680803343"><span class="annot"><a href="#local-6989586621680803343"><span class="hs-identifier hs-type">val</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-121"></span><span>  </span><span id="TaggedVal"><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-var">TaggedVal</span></a></span></span><span>
</span><span id="line-122"></span><span>    </span><span class="annot"><a href="#local-6989586621680803343"><span class="hs-identifier hs-type">val</span></a></span><span>
</span><span id="line-123"></span><span>    </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-comment">-- ^ insertion time</span><span>
</span><span id="line-124"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680802831"><span id="local-6989586621680802833"><span id="local-6989586621680802835"><span id="local-6989586621680802837"><span id="local-6989586621680802839"><span id="local-6989586621680802841"><span id="local-6989586621680802843"><span id="local-6989586621680802845"><span id="local-6989586621680802847"><span id="local-6989586621680802853"><span id="local-6989586621680802855"><span id="local-6989586621680802857"><span id="local-6989586621680802861"><span id="local-6989586621680802866"><span class="annot"><span class="annottext">Typeable (TaggedVal val)
Typeable (TaggedVal val)
-&gt; (forall (c :: * -&gt; *).
    (forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
    -&gt; (forall g. g -&gt; c g) -&gt; TaggedVal val -&gt; c (TaggedVal val))
-&gt; (forall (c :: * -&gt; *).
    (forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
    -&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c (TaggedVal val))
-&gt; (TaggedVal val -&gt; Constr)
-&gt; (TaggedVal val -&gt; DataType)
-&gt; (forall (t :: * -&gt; *) (c :: * -&gt; *).
    Typeable t =&gt;
    (forall d. Data d =&gt; c (t d)) -&gt; Maybe (c (TaggedVal val)))
-&gt; (forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
    Typeable t =&gt;
    (forall d e. (Data d, Data e) =&gt; c (t d e))
    -&gt; Maybe (c (TaggedVal val)))
-&gt; ((forall b. Data b =&gt; b -&gt; b) -&gt; TaggedVal val -&gt; TaggedVal val)
-&gt; (forall r r'.
    (r -&gt; r' -&gt; r)
    -&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; TaggedVal val -&gt; r)
-&gt; (forall r r'.
    (r' -&gt; r -&gt; r)
    -&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; TaggedVal val -&gt; r)
-&gt; (forall u. (forall d. Data d =&gt; d -&gt; u) -&gt; TaggedVal val -&gt; [u])
-&gt; (forall u.
    Int -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; TaggedVal val -&gt; u)
-&gt; (forall (m :: * -&gt; *).
    Monad m =&gt;
    (forall d. Data d =&gt; d -&gt; m d)
    -&gt; TaggedVal val -&gt; m (TaggedVal val))
-&gt; (forall (m :: * -&gt; *).
    MonadPlus m =&gt;
    (forall d. Data d =&gt; d -&gt; m d)
    -&gt; TaggedVal val -&gt; m (TaggedVal val))
-&gt; (forall (m :: * -&gt; *).
    MonadPlus m =&gt;
    (forall d. Data d =&gt; d -&gt; m d)
    -&gt; TaggedVal val -&gt; m (TaggedVal val))
-&gt; Data (TaggedVal val)
TaggedVal val -&gt; DataType
TaggedVal val -&gt; Constr
(forall b. Data b =&gt; b -&gt; b) -&gt; TaggedVal val -&gt; TaggedVal val
forall {val}. Data val =&gt; Typeable (TaggedVal val)
forall val. Data val =&gt; TaggedVal val -&gt; DataType
forall val. Data val =&gt; TaggedVal val -&gt; Constr
forall val.
Data val =&gt;
(forall b. Data b =&gt; b -&gt; b) -&gt; TaggedVal val -&gt; TaggedVal val
forall val u.
Data val =&gt;
Int -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; TaggedVal val -&gt; u
forall val u.
Data val =&gt;
(forall d. Data d =&gt; d -&gt; u) -&gt; TaggedVal val -&gt; [u]
forall val r r'.
Data val =&gt;
(r -&gt; r' -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; TaggedVal val -&gt; r
forall val r r'.
Data val =&gt;
(r' -&gt; r -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; TaggedVal val -&gt; r
forall val (m :: * -&gt; *).
(Data val, Monad m) =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; TaggedVal val -&gt; m (TaggedVal val)
forall val (m :: * -&gt; *).
(Data val, MonadPlus m) =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; TaggedVal val -&gt; m (TaggedVal val)
forall val (c :: * -&gt; *).
Data val =&gt;
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c (TaggedVal val)
forall val (c :: * -&gt; *).
Data val =&gt;
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; TaggedVal val -&gt; c (TaggedVal val)
forall val (t :: * -&gt; *) (c :: * -&gt; *).
(Data val, Typeable t) =&gt;
(forall d. Data d =&gt; c (t d)) -&gt; Maybe (c (TaggedVal val))
forall val (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
(Data val, Typeable t) =&gt;
(forall d e. (Data d, Data e) =&gt; c (t d e))
-&gt; Maybe (c (TaggedVal val))
forall a.
Typeable a
-&gt; (forall (c :: * -&gt; *).
    (forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
    -&gt; (forall g. g -&gt; c g) -&gt; a -&gt; c a)
-&gt; (forall (c :: * -&gt; *).
    (forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
    -&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c a)
-&gt; (a -&gt; Constr)
-&gt; (a -&gt; DataType)
-&gt; (forall (t :: * -&gt; *) (c :: * -&gt; *).
    Typeable t =&gt;
    (forall d. Data d =&gt; c (t d)) -&gt; Maybe (c a))
-&gt; (forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
    Typeable t =&gt;
    (forall d e. (Data d, Data e) =&gt; c (t d e)) -&gt; Maybe (c a))
-&gt; ((forall b. Data b =&gt; b -&gt; b) -&gt; a -&gt; a)
-&gt; (forall r r'.
    (r -&gt; r' -&gt; r) -&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; a -&gt; r)
-&gt; (forall r r'.
    (r' -&gt; r -&gt; r) -&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; a -&gt; r)
-&gt; (forall u. (forall d. Data d =&gt; d -&gt; u) -&gt; a -&gt; [u])
-&gt; (forall u. Int -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; a -&gt; u)
-&gt; (forall (m :: * -&gt; *).
    Monad m =&gt;
    (forall d. Data d =&gt; d -&gt; m d) -&gt; a -&gt; m a)
-&gt; (forall (m :: * -&gt; *).
    MonadPlus m =&gt;
    (forall d. Data d =&gt; d -&gt; m d) -&gt; a -&gt; m a)
-&gt; (forall (m :: * -&gt; *).
    MonadPlus m =&gt;
    (forall d. Data d =&gt; d -&gt; m d) -&gt; a -&gt; m a)
-&gt; Data a
forall u. Int -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; TaggedVal val -&gt; u
forall u. (forall d. Data d =&gt; d -&gt; u) -&gt; TaggedVal val -&gt; [u]
forall r r'.
(r -&gt; r' -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; TaggedVal val -&gt; r
forall r r'.
(r' -&gt; r -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; TaggedVal val -&gt; r
forall (m :: * -&gt; *).
Monad m =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; TaggedVal val -&gt; m (TaggedVal val)
forall (m :: * -&gt; *).
MonadPlus m =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; TaggedVal val -&gt; m (TaggedVal val)
forall (c :: * -&gt; *).
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c (TaggedVal val)
forall (c :: * -&gt; *).
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; TaggedVal val -&gt; c (TaggedVal val)
forall (t :: * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d. Data d =&gt; c (t d)) -&gt; Maybe (c (TaggedVal val))
forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d e. (Data d, Data e) =&gt; c (t d e))
-&gt; Maybe (c (TaggedVal val))
gmapMo :: forall (m :: * -&gt; *).
MonadPlus m =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; TaggedVal val -&gt; m (TaggedVal val)
$cgmapMo :: forall val (m :: * -&gt; *).
(Data val, MonadPlus m) =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; TaggedVal val -&gt; m (TaggedVal val)
gmapMp :: forall (m :: * -&gt; *).
MonadPlus m =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; TaggedVal val -&gt; m (TaggedVal val)
$cgmapMp :: forall val (m :: * -&gt; *).
(Data val, MonadPlus m) =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; TaggedVal val -&gt; m (TaggedVal val)
gmapM :: forall (m :: * -&gt; *).
Monad m =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; TaggedVal val -&gt; m (TaggedVal val)
$cgmapM :: forall val (m :: * -&gt; *).
(Data val, Monad m) =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; TaggedVal val -&gt; m (TaggedVal val)
gmapQi :: forall u. Int -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; TaggedVal val -&gt; u
$cgmapQi :: forall val u.
Data val =&gt;
Int -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; TaggedVal val -&gt; u
gmapQ :: forall u. (forall d. Data d =&gt; d -&gt; u) -&gt; TaggedVal val -&gt; [u]
$cgmapQ :: forall val u.
Data val =&gt;
(forall d. Data d =&gt; d -&gt; u) -&gt; TaggedVal val -&gt; [u]
gmapQr :: forall r r'.
(r' -&gt; r -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; TaggedVal val -&gt; r
$cgmapQr :: forall val r r'.
Data val =&gt;
(r' -&gt; r -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; TaggedVal val -&gt; r
gmapQl :: forall r r'.
(r -&gt; r' -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; TaggedVal val -&gt; r
$cgmapQl :: forall val r r'.
Data val =&gt;
(r -&gt; r' -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; TaggedVal val -&gt; r
gmapT :: (forall b. Data b =&gt; b -&gt; b) -&gt; TaggedVal val -&gt; TaggedVal val
$cgmapT :: forall val.
Data val =&gt;
(forall b. Data b =&gt; b -&gt; b) -&gt; TaggedVal val -&gt; TaggedVal val
dataCast2 :: forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d e. (Data d, Data e) =&gt; c (t d e))
-&gt; Maybe (c (TaggedVal val))
$cdataCast2 :: forall val (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
(Data val, Typeable t) =&gt;
(forall d e. (Data d, Data e) =&gt; c (t d e))
-&gt; Maybe (c (TaggedVal val))
dataCast1 :: forall (t :: * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d. Data d =&gt; c (t d)) -&gt; Maybe (c (TaggedVal val))
$cdataCast1 :: forall val (t :: * -&gt; *) (c :: * -&gt; *).
(Data val, Typeable t) =&gt;
(forall d. Data d =&gt; c (t d)) -&gt; Maybe (c (TaggedVal val))
dataTypeOf :: TaggedVal val -&gt; DataType
$cdataTypeOf :: forall val. Data val =&gt; TaggedVal val -&gt; DataType
toConstr :: TaggedVal val -&gt; Constr
$ctoConstr :: forall val. Data val =&gt; TaggedVal val -&gt; Constr
gunfold :: forall (c :: * -&gt; *).
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c (TaggedVal val)
$cgunfold :: forall val (c :: * -&gt; *).
Data val =&gt;
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c (TaggedVal val)
gfoldl :: forall (c :: * -&gt; *).
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; TaggedVal val -&gt; c (TaggedVal val)
$cgfoldl :: forall val (c :: * -&gt; *).
Data val =&gt;
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; TaggedVal val -&gt; c (TaggedVal val)
</span><a href="../../base/src/Data.Data.html#Data"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Data</span></a></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680802826"><span id="local-6989586621680802828"><span class="annot"><span class="annottext">(forall a b. (a -&gt; b) -&gt; TaggedVal a -&gt; TaggedVal b)
-&gt; (forall a b. a -&gt; TaggedVal b -&gt; TaggedVal a)
-&gt; Functor TaggedVal
forall a b. a -&gt; TaggedVal b -&gt; TaggedVal a
forall a b. (a -&gt; b) -&gt; TaggedVal a -&gt; TaggedVal b
forall (f :: * -&gt; *).
(forall a b. (a -&gt; b) -&gt; f a -&gt; f b)
-&gt; (forall a b. a -&gt; f b -&gt; f a) -&gt; Functor f
&lt;$ :: forall a b. a -&gt; TaggedVal b -&gt; TaggedVal a
$c&lt;$ :: forall a b. a -&gt; TaggedVal b -&gt; TaggedVal a
fmap :: forall a b. (a -&gt; b) -&gt; TaggedVal a -&gt; TaggedVal b
$cfmap :: forall a b. (a -&gt; b) -&gt; TaggedVal a -&gt; TaggedVal b
</span><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Functor</span></a></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span id="local-6989586621680803337"><span class="annot"><a href="GHC.Types.Unique.DFM.html#taggedFst"><span class="hs-identifier hs-type">taggedFst</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803337"><span class="hs-identifier hs-type">val</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803337"><span class="hs-identifier hs-type">val</span></a></span></span><span>
</span><span id="line-127"></span><span id="taggedFst"><span class="annot"><span class="annottext">taggedFst :: forall val. TaggedVal val -&gt; val
</span><a href="GHC.Types.Unique.DFM.html#taggedFst"><span class="hs-identifier hs-var hs-var">taggedFst</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span id="local-6989586621680802822"><span class="annot"><span class="annottext">val
</span><a href="#local-6989586621680802822"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">val
</span><a href="#local-6989586621680802822"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span id="local-6989586621680803335"><span class="annot"><a href="GHC.Types.Unique.DFM.html#taggedSnd"><span class="hs-identifier hs-type">taggedSnd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803335"><span class="hs-identifier hs-type">val</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span></span><span>
</span><span id="line-130"></span><span id="taggedSnd"><span class="annot"><span class="annottext">taggedSnd :: forall val. TaggedVal val -&gt; Int
</span><a href="GHC.Types.Unique.DFM.html#taggedSnd"><span class="hs-identifier hs-var hs-var">taggedSnd</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span class="annot"><span class="annottext">val
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680802820"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802820"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802820"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span id="local-6989586621680803332"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680802817"><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="#local-6989586621680803332"><span class="hs-identifier hs-type">val</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803332"><span class="hs-identifier hs-type">val</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-133"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span id="local-6989586621680802814"><span class="annot"><span class="annottext">val
</span><a href="#local-6989586621680802814"><span class="hs-identifier hs-var">v1</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802813"><span class="annot"><span class="annottext">== :: TaggedVal val -&gt; TaggedVal val -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">==</span></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span id="local-6989586621680802812"><span class="annot"><span class="annottext">val
</span><a href="#local-6989586621680802812"><span class="hs-identifier hs-var">v2</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">val
</span><a href="#local-6989586621680802814"><span class="hs-identifier hs-var">v1</span></a></span><span> </span><span class="annot"><span class="annottext">val -&gt; val -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">val
</span><a href="#local-6989586621680802812"><span class="hs-identifier hs-var">v2</span></a></span></span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span class="hs-comment">-- | Type of unique deterministic finite maps</span><span>
</span><span id="line-136"></span><span class="hs-comment">--</span><span>
</span><span id="line-137"></span><span class="hs-comment">-- The key is just here to keep us honest. It's always safe</span><span>
</span><span id="line-138"></span><span class="hs-comment">-- to use a single type as key.</span><span>
</span><span id="line-139"></span><span class="hs-comment">-- If two types don't overlap in their uniques it's also safe</span><span>
</span><span id="line-140"></span><span class="hs-comment">-- to index the same map at multiple key types. But this is</span><span>
</span><span id="line-141"></span><span class="hs-comment">-- very much discouraged.</span><span>
</span><span id="line-142"></span><span class="hs-keyword">data</span><span> </span><span id="UniqDFM"><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-var">UniqDFM</span></a></span></span><span> </span><span id="local-6989586621680803328"><span class="annot"><a href="#local-6989586621680803328"><span class="hs-identifier hs-type">key</span></a></span></span><span> </span><span id="local-6989586621680803327"><span class="annot"><a href="#local-6989586621680803327"><span class="hs-identifier hs-type">ele</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-143"></span><span>  </span><span id="UDFM"><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span></span><span>
</span><span id="line-144"></span><span>    </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.IntMap.Internal.html#IntMap"><span class="hs-identifier hs-type">M.IntMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803327"><span class="hs-identifier hs-type">ele</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- A map where keys are Unique's values and</span><span>
</span><span id="line-145"></span><span>                                </span><span class="hs-comment">-- values are tagged with insertion time.</span><span>
</span><span id="line-146"></span><span>                                </span><span class="hs-comment">-- The invariant is that all the tags will</span><span>
</span><span id="line-147"></span><span>                                </span><span class="hs-comment">-- be distinct within a single map</span><span>
</span><span id="line-148"></span><span>    </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>         </span><span class="hs-comment">-- Upper bound on the values' insertion</span><span>
</span><span id="line-149"></span><span>                                </span><span class="hs-comment">-- time. See Note [Overflow on plusUDFM]</span><span>
</span><span id="line-150"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680802768"><span id="local-6989586621680802770"><span id="local-6989586621680802772"><span id="local-6989586621680802774"><span id="local-6989586621680802776"><span id="local-6989586621680802778"><span id="local-6989586621680802780"><span id="local-6989586621680802782"><span id="local-6989586621680802789"><span id="local-6989586621680802791"><span id="local-6989586621680802793"><span id="local-6989586621680802795"><span id="local-6989586621680802800"><span id="local-6989586621680802806"><span class="annot"><span class="annottext">Typeable (UniqDFM key ele)
Typeable (UniqDFM key ele)
-&gt; (forall (c :: * -&gt; *).
    (forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
    -&gt; (forall g. g -&gt; c g) -&gt; UniqDFM key ele -&gt; c (UniqDFM key ele))
-&gt; (forall (c :: * -&gt; *).
    (forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
    -&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c (UniqDFM key ele))
-&gt; (UniqDFM key ele -&gt; Constr)
-&gt; (UniqDFM key ele -&gt; DataType)
-&gt; (forall (t :: * -&gt; *) (c :: * -&gt; *).
    Typeable t =&gt;
    (forall d. Data d =&gt; c (t d)) -&gt; Maybe (c (UniqDFM key ele)))
-&gt; (forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
    Typeable t =&gt;
    (forall d e. (Data d, Data e) =&gt; c (t d e))
    -&gt; Maybe (c (UniqDFM key ele)))
-&gt; ((forall b. Data b =&gt; b -&gt; b)
    -&gt; UniqDFM key ele -&gt; UniqDFM key ele)
-&gt; (forall r r'.
    (r -&gt; r' -&gt; r)
    -&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; UniqDFM key ele -&gt; r)
-&gt; (forall r r'.
    (r' -&gt; r -&gt; r)
    -&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; UniqDFM key ele -&gt; r)
-&gt; (forall u.
    (forall d. Data d =&gt; d -&gt; u) -&gt; UniqDFM key ele -&gt; [u])
-&gt; (forall u.
    Int -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; UniqDFM key ele -&gt; u)
-&gt; (forall (m :: * -&gt; *).
    Monad m =&gt;
    (forall d. Data d =&gt; d -&gt; m d)
    -&gt; UniqDFM key ele -&gt; m (UniqDFM key ele))
-&gt; (forall (m :: * -&gt; *).
    MonadPlus m =&gt;
    (forall d. Data d =&gt; d -&gt; m d)
    -&gt; UniqDFM key ele -&gt; m (UniqDFM key ele))
-&gt; (forall (m :: * -&gt; *).
    MonadPlus m =&gt;
    (forall d. Data d =&gt; d -&gt; m d)
    -&gt; UniqDFM key ele -&gt; m (UniqDFM key ele))
-&gt; Data (UniqDFM key ele)
UniqDFM key ele -&gt; DataType
UniqDFM key ele -&gt; Constr
(forall b. Data b =&gt; b -&gt; b) -&gt; UniqDFM key ele -&gt; UniqDFM key ele
forall a.
Typeable a
-&gt; (forall (c :: * -&gt; *).
    (forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
    -&gt; (forall g. g -&gt; c g) -&gt; a -&gt; c a)
-&gt; (forall (c :: * -&gt; *).
    (forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
    -&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c a)
-&gt; (a -&gt; Constr)
-&gt; (a -&gt; DataType)
-&gt; (forall (t :: * -&gt; *) (c :: * -&gt; *).
    Typeable t =&gt;
    (forall d. Data d =&gt; c (t d)) -&gt; Maybe (c a))
-&gt; (forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
    Typeable t =&gt;
    (forall d e. (Data d, Data e) =&gt; c (t d e)) -&gt; Maybe (c a))
-&gt; ((forall b. Data b =&gt; b -&gt; b) -&gt; a -&gt; a)
-&gt; (forall r r'.
    (r -&gt; r' -&gt; r) -&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; a -&gt; r)
-&gt; (forall r r'.
    (r' -&gt; r -&gt; r) -&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; a -&gt; r)
-&gt; (forall u. (forall d. Data d =&gt; d -&gt; u) -&gt; a -&gt; [u])
-&gt; (forall u. Int -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; a -&gt; u)
-&gt; (forall (m :: * -&gt; *).
    Monad m =&gt;
    (forall d. Data d =&gt; d -&gt; m d) -&gt; a -&gt; m a)
-&gt; (forall (m :: * -&gt; *).
    MonadPlus m =&gt;
    (forall d. Data d =&gt; d -&gt; m d) -&gt; a -&gt; m a)
-&gt; (forall (m :: * -&gt; *).
    MonadPlus m =&gt;
    (forall d. Data d =&gt; d -&gt; m d) -&gt; a -&gt; m a)
-&gt; Data a
forall u.
Int -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; UniqDFM key ele -&gt; u
forall u. (forall d. Data d =&gt; d -&gt; u) -&gt; UniqDFM key ele -&gt; [u]
forall {key} {ele}.
(Data key, Data ele) =&gt;
Typeable (UniqDFM key ele)
forall key ele. (Data key, Data ele) =&gt; UniqDFM key ele -&gt; DataType
forall key ele. (Data key, Data ele) =&gt; UniqDFM key ele -&gt; Constr
forall key ele.
(Data key, Data ele) =&gt;
(forall b. Data b =&gt; b -&gt; b) -&gt; UniqDFM key ele -&gt; UniqDFM key ele
forall key ele u.
(Data key, Data ele) =&gt;
Int -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; UniqDFM key ele -&gt; u
forall key ele u.
(Data key, Data ele) =&gt;
(forall d. Data d =&gt; d -&gt; u) -&gt; UniqDFM key ele -&gt; [u]
forall key ele r r'.
(Data key, Data ele) =&gt;
(r -&gt; r' -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; UniqDFM key ele -&gt; r
forall key ele r r'.
(Data key, Data ele) =&gt;
(r' -&gt; r -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; UniqDFM key ele -&gt; r
forall key ele (m :: * -&gt; *).
(Data key, Data ele, Monad m) =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; UniqDFM key ele -&gt; m (UniqDFM key ele)
forall key ele (m :: * -&gt; *).
(Data key, Data ele, MonadPlus m) =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; UniqDFM key ele -&gt; m (UniqDFM key ele)
forall key ele (c :: * -&gt; *).
(Data key, Data ele) =&gt;
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c (UniqDFM key ele)
forall key ele (c :: * -&gt; *).
(Data key, Data ele) =&gt;
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; UniqDFM key ele -&gt; c (UniqDFM key ele)
forall key ele (t :: * -&gt; *) (c :: * -&gt; *).
(Data key, Data ele, Typeable t) =&gt;
(forall d. Data d =&gt; c (t d)) -&gt; Maybe (c (UniqDFM key ele))
forall key ele (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
(Data key, Data ele, Typeable t) =&gt;
(forall d e. (Data d, Data e) =&gt; c (t d e))
-&gt; Maybe (c (UniqDFM key ele))
forall r r'.
(r -&gt; r' -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; UniqDFM key ele -&gt; r
forall r r'.
(r' -&gt; r -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; UniqDFM key ele -&gt; r
forall (m :: * -&gt; *).
Monad m =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; UniqDFM key ele -&gt; m (UniqDFM key ele)
forall (m :: * -&gt; *).
MonadPlus m =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; UniqDFM key ele -&gt; m (UniqDFM key ele)
forall (c :: * -&gt; *).
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c (UniqDFM key ele)
forall (c :: * -&gt; *).
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; UniqDFM key ele -&gt; c (UniqDFM key ele)
forall (t :: * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d. Data d =&gt; c (t d)) -&gt; Maybe (c (UniqDFM key ele))
forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d e. (Data d, Data e) =&gt; c (t d e))
-&gt; Maybe (c (UniqDFM key ele))
gmapMo :: forall (m :: * -&gt; *).
MonadPlus m =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; UniqDFM key ele -&gt; m (UniqDFM key ele)
$cgmapMo :: forall key ele (m :: * -&gt; *).
(Data key, Data ele, MonadPlus m) =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; UniqDFM key ele -&gt; m (UniqDFM key ele)
gmapMp :: forall (m :: * -&gt; *).
MonadPlus m =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; UniqDFM key ele -&gt; m (UniqDFM key ele)
$cgmapMp :: forall key ele (m :: * -&gt; *).
(Data key, Data ele, MonadPlus m) =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; UniqDFM key ele -&gt; m (UniqDFM key ele)
gmapM :: forall (m :: * -&gt; *).
Monad m =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; UniqDFM key ele -&gt; m (UniqDFM key ele)
$cgmapM :: forall key ele (m :: * -&gt; *).
(Data key, Data ele, Monad m) =&gt;
(forall d. Data d =&gt; d -&gt; m d)
-&gt; UniqDFM key ele -&gt; m (UniqDFM key ele)
gmapQi :: forall u.
Int -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; UniqDFM key ele -&gt; u
$cgmapQi :: forall key ele u.
(Data key, Data ele) =&gt;
Int -&gt; (forall d. Data d =&gt; d -&gt; u) -&gt; UniqDFM key ele -&gt; u
gmapQ :: forall u. (forall d. Data d =&gt; d -&gt; u) -&gt; UniqDFM key ele -&gt; [u]
$cgmapQ :: forall key ele u.
(Data key, Data ele) =&gt;
(forall d. Data d =&gt; d -&gt; u) -&gt; UniqDFM key ele -&gt; [u]
gmapQr :: forall r r'.
(r' -&gt; r -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; UniqDFM key ele -&gt; r
$cgmapQr :: forall key ele r r'.
(Data key, Data ele) =&gt;
(r' -&gt; r -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; UniqDFM key ele -&gt; r
gmapQl :: forall r r'.
(r -&gt; r' -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; UniqDFM key ele -&gt; r
$cgmapQl :: forall key ele r r'.
(Data key, Data ele) =&gt;
(r -&gt; r' -&gt; r)
-&gt; r -&gt; (forall d. Data d =&gt; d -&gt; r') -&gt; UniqDFM key ele -&gt; r
gmapT :: (forall b. Data b =&gt; b -&gt; b) -&gt; UniqDFM key ele -&gt; UniqDFM key ele
$cgmapT :: forall key ele.
(Data key, Data ele) =&gt;
(forall b. Data b =&gt; b -&gt; b) -&gt; UniqDFM key ele -&gt; UniqDFM key ele
dataCast2 :: forall (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d e. (Data d, Data e) =&gt; c (t d e))
-&gt; Maybe (c (UniqDFM key ele))
$cdataCast2 :: forall key ele (t :: * -&gt; * -&gt; *) (c :: * -&gt; *).
(Data key, Data ele, Typeable t) =&gt;
(forall d e. (Data d, Data e) =&gt; c (t d e))
-&gt; Maybe (c (UniqDFM key ele))
dataCast1 :: forall (t :: * -&gt; *) (c :: * -&gt; *).
Typeable t =&gt;
(forall d. Data d =&gt; c (t d)) -&gt; Maybe (c (UniqDFM key ele))
$cdataCast1 :: forall key ele (t :: * -&gt; *) (c :: * -&gt; *).
(Data key, Data ele, Typeable t) =&gt;
(forall d. Data d =&gt; c (t d)) -&gt; Maybe (c (UniqDFM key ele))
dataTypeOf :: UniqDFM key ele -&gt; DataType
$cdataTypeOf :: forall key ele. (Data key, Data ele) =&gt; UniqDFM key ele -&gt; DataType
toConstr :: UniqDFM key ele -&gt; Constr
$ctoConstr :: forall key ele. (Data key, Data ele) =&gt; UniqDFM key ele -&gt; Constr
gunfold :: forall (c :: * -&gt; *).
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c (UniqDFM key ele)
$cgunfold :: forall key ele (c :: * -&gt; *).
(Data key, Data ele) =&gt;
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c (UniqDFM key ele)
gfoldl :: forall (c :: * -&gt; *).
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; UniqDFM key ele -&gt; c (UniqDFM key ele)
$cgfoldl :: forall key ele (c :: * -&gt; *).
(Data key, Data ele) =&gt;
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; UniqDFM key ele -&gt; c (UniqDFM key ele)
</span><a href="../../base/src/Data.Data.html#Data"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Data</span></a></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680802760"><span id="local-6989586621680802765"><span class="annot"><span class="annottext">(forall a b. (a -&gt; b) -&gt; UniqDFM key a -&gt; UniqDFM key b)
-&gt; (forall a b. a -&gt; UniqDFM key b -&gt; UniqDFM key a)
-&gt; Functor (UniqDFM key)
forall a b. a -&gt; UniqDFM key b -&gt; UniqDFM key a
forall a b. (a -&gt; b) -&gt; UniqDFM key a -&gt; UniqDFM key b
forall key a b. a -&gt; UniqDFM key b -&gt; UniqDFM key a
forall key a b. (a -&gt; b) -&gt; UniqDFM key a -&gt; UniqDFM key b
forall (f :: * -&gt; *).
(forall a b. (a -&gt; b) -&gt; f a -&gt; f b)
-&gt; (forall a b. a -&gt; f b -&gt; f a) -&gt; Functor f
&lt;$ :: forall a b. a -&gt; UniqDFM key b -&gt; UniqDFM key a
$c&lt;$ :: forall key a b. a -&gt; UniqDFM key b -&gt; UniqDFM key a
fmap :: forall a b. (a -&gt; b) -&gt; UniqDFM key a -&gt; UniqDFM key b
$cfmap :: forall key a b. (a -&gt; b) -&gt; UniqDFM key a -&gt; UniqDFM key b
</span><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Functor</span></a></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span>
</span><span id="line-152"></span><span class="hs-comment">-- | Deterministic, in O(n log n).</span><span>
</span><span id="line-153"></span><span id="local-6989586621680803310"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680802724"><span id="local-6989586621680802726"><span id="local-6989586621680802728"><span id="local-6989586621680802730"><span id="local-6989586621680802732"><span id="local-6989586621680802734"><span id="local-6989586621680802736"><span id="local-6989586621680802738"><span id="local-6989586621680802740"><span id="local-6989586621680802742"><span id="local-6989586621680802744"><span id="local-6989586621680802746"><span id="local-6989586621680802748"><span id="local-6989586621680802751"><span id="local-6989586621680802753"><span id="local-6989586621680802755"><span class="annot"><a href="../../base/src/Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803310"><span class="hs-identifier hs-type">key</span></a></span><span class="hs-special">)</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-154"></span><span>  </span><span id="local-6989586621680802722"><span class="annot"><span class="annottext">foldr :: forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; UniqDFM key a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var hs-var hs-var hs-var">foldr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b -&gt; b) -&gt; b -&gt; UniqDFM key a -&gt; b
forall elt a key. (elt -&gt; a -&gt; a) -&gt; a -&gt; UniqDFM key elt -&gt; a
</span><a href="GHC.Types.Unique.DFM.html#foldUDFM"><span class="hs-identifier hs-var">foldUDFM</span></a></span></span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span class="hs-comment">-- | Deterministic, in O(n log n).</span><span>
</span><span id="line-157"></span><span id="local-6989586621680803293"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680802710"><span id="local-6989586621680802712"><span id="local-6989586621680802714"><span class="annot"><a href="../../base/src/Data.Traversable.html#Traversable"><span class="hs-identifier hs-type">Traversable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803293"><span class="hs-identifier hs-type">key</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-158"></span><span>  </span><span id="local-6989586621680802700"><span class="annot"><span class="annottext">traverse :: forall (f :: * -&gt; *) a b.
Applicative f =&gt;
(a -&gt; f b) -&gt; UniqDFM key a -&gt; f (UniqDFM key b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var hs-var hs-var hs-var">traverse</span></a></span></span><span> </span><span id="local-6989586621680802698"><span class="annot"><span class="annottext">a -&gt; f b
</span><a href="#local-6989586621680802698"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([(Unique, b)] -&gt; UniqDFM key b)
-&gt; f [(Unique, b)] -&gt; f (UniqDFM key b)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">[(Unique, b)] -&gt; UniqDFM key b
forall elt key. [(Unique, elt)] -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#listToUDFM_Directly"><span class="hs-identifier hs-var">listToUDFM_Directly</span></a></span><span>
</span><span id="line-159"></span><span>             </span><span class="annot"><span class="annottext">(f [(Unique, b)] -&gt; f (UniqDFM key b))
-&gt; (UniqDFM key a -&gt; f [(Unique, b)])
-&gt; UniqDFM key a
-&gt; f (UniqDFM key b)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">((Unique, a) -&gt; f (Unique, b)) -&gt; [(Unique, a)] -&gt; f [(Unique, b)]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621680802696"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802696"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621680802695"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680802695"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802696"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(b -&gt; (Unique, b)) -&gt; f b -&gt; f (Unique, b)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; f b
</span><a href="#local-6989586621680802698"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680802695"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>             </span><span class="annot"><span class="annottext">([(Unique, a)] -&gt; f [(Unique, b)])
-&gt; (UniqDFM key a -&gt; [(Unique, a)])
-&gt; UniqDFM key a
-&gt; f [(Unique, b)]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key a -&gt; [(Unique, a)]
forall key elt. UniqDFM key elt -&gt; [(Unique, elt)]
</span><a href="GHC.Types.Unique.DFM.html#udfmToList"><span class="hs-identifier hs-var">udfmToList</span></a></span></span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span id="local-6989586621680803276"><span id="local-6989586621680803277"><span class="annot"><a href="GHC.Types.Unique.DFM.html#emptyUDFM"><span class="hs-identifier hs-type">emptyUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803277"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803276"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-163"></span><span id="emptyUDFM"><span class="annot"><span class="annottext">emptyUDFM :: forall key elt. UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#emptyUDFM"><span class="hs-identifier hs-var hs-var">emptyUDFM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
forall a. IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#empty"><span class="hs-identifier hs-var">M.empty</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span id="local-6989586621680803270"><span id="local-6989586621680803272"><span class="annot"><a href="GHC.Types.Unique.DFM.html#unitUDFM"><span class="hs-identifier hs-type">unitUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803272"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803272"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803270"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803272"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803270"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-166"></span><span id="unitUDFM"><span class="annot"><span class="annottext">unitUDFM :: forall key elt. Uniquable key =&gt; key -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#unitUDFM"><span class="hs-identifier hs-var hs-var">unitUDFM</span></a></span></span><span> </span><span id="local-6989586621680802690"><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802690"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621680802689"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802689"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; TaggedVal elt -&gt; IntMap (TaggedVal elt)
forall a. Int -&gt; a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#singleton"><span class="hs-identifier hs-var">M.singleton</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; Int
</span><a href="GHC.Types.Unique.html#getKey"><span class="hs-identifier hs-var">getKey</span></a></span><span> </span><span class="annot"><span class="annottext">(Unique -&gt; Int) -&gt; Unique -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">key -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802690"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">elt -&gt; Int -&gt; TaggedVal elt
forall val. val -&gt; Int -&gt; TaggedVal val
</span><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-var">TaggedVal</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802689"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-167"></span><span>
</span><span id="line-168"></span><span class="hs-comment">-- The new binding always goes to the right of existing ones</span><span>
</span><span id="line-169"></span><span id="local-6989586621680803261"><span id="local-6989586621680803262"><span class="annot"><a href="GHC.Types.Unique.DFM.html#addToUDFM"><span class="hs-identifier hs-type">addToUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803262"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803262"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803261"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803262"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803261"><span class="hs-identifier hs-type">elt</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803262"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803261"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-170"></span><span id="addToUDFM"><span class="annot"><span class="annottext">addToUDFM :: forall key elt.
Uniquable key =&gt;
UniqDFM key elt -&gt; key -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addToUDFM"><span class="hs-identifier hs-var hs-var">addToUDFM</span></a></span></span><span> </span><span id="local-6989586621680802684"><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802684"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802683"><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802683"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621680802682"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802682"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt -&gt; Unique -&gt; elt -&gt; UniqDFM key elt
forall key elt. UniqDFM key elt -&gt; Unique -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addToUDFM_Directly"><span class="hs-identifier hs-var">addToUDFM_Directly</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802684"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">key -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802683"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802682"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span class="hs-comment">-- The new binding always goes to the right of existing ones</span><span>
</span><span id="line-173"></span><span id="local-6989586621680803257"><span id="local-6989586621680803258"><span class="annot"><a href="GHC.Types.Unique.DFM.html#addToUDFM_Directly"><span class="hs-identifier hs-type">addToUDFM_Directly</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803258"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803257"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803257"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803258"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803257"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-174"></span><span id="addToUDFM_Directly"><span class="annot"><span class="annottext">addToUDFM_Directly :: forall key elt. UniqDFM key elt -&gt; Unique -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addToUDFM_Directly"><span class="hs-identifier hs-var hs-var">addToUDFM_Directly</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802678"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802678"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802677"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802677"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802676"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802676"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621680802675"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802675"><span class="hs-identifier hs-var">v</span></a></span></span><span>
</span><span id="line-175"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; TaggedVal elt -&gt; TaggedVal elt)
-&gt; Int
-&gt; TaggedVal elt
-&gt; IntMap (TaggedVal elt)
-&gt; IntMap (TaggedVal elt)
forall a. (a -&gt; a -&gt; a) -&gt; Int -&gt; a -&gt; IntMap a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#insertWith"><span class="hs-identifier hs-var">M.insertWith</span></a></span><span> </span><span class="annot"><span class="annottext">TaggedVal elt -&gt; TaggedVal elt -&gt; TaggedVal elt
forall {val} {val}. TaggedVal val -&gt; TaggedVal val -&gt; TaggedVal val
</span><a href="#local-6989586621680802673"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; Int
</span><a href="GHC.Types.Unique.html#getKey"><span class="hs-identifier hs-var">getKey</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802676"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">elt -&gt; Int -&gt; TaggedVal elt
forall val. val -&gt; Int -&gt; TaggedVal val
</span><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-var">TaggedVal</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802675"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802677"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802678"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802677"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-176"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-177"></span><span>    </span><span id="local-6989586621680802673"><span class="annot"><span class="annottext">tf :: TaggedVal val -&gt; TaggedVal val -&gt; TaggedVal val
</span><a href="#local-6989586621680802673"><span class="hs-identifier hs-var hs-var">tf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span id="local-6989586621680802671"><span class="annot"><span class="annottext">val
</span><a href="#local-6989586621680802671"><span class="hs-identifier hs-var">new_v</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span class="annot"><span class="annottext">val
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680802670"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802670"><span class="hs-identifier hs-var">old_i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">val -&gt; Int -&gt; TaggedVal val
forall val. val -&gt; Int -&gt; TaggedVal val
</span><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-var">TaggedVal</span></a></span><span> </span><span class="annot"><span class="annottext">val
</span><a href="#local-6989586621680802671"><span class="hs-identifier hs-var">new_v</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802670"><span class="hs-identifier hs-var">old_i</span></a></span><span>
</span><span id="line-178"></span><span>      </span><span class="hs-comment">-- Keep the old tag, but insert the new value</span><span>
</span><span id="line-179"></span><span>      </span><span class="hs-comment">-- This means that udfmToList typically returns elements</span><span>
</span><span id="line-180"></span><span>      </span><span class="hs-comment">-- in the order of insertion, rather than the reverse</span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span id="local-6989586621680803249"><span id="local-6989586621680803250"><span class="annot"><a href="GHC.Types.Unique.DFM.html#addToUDFM_C_Directly"><span class="hs-identifier hs-type">addToUDFM_C_Directly</span></a></span><span>
</span><span id="line-183"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803250"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803250"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803250"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span>   </span><span class="hs-comment">-- old -&gt; new -&gt; result</span><span>
</span><span id="line-184"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803249"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803250"><span class="hs-identifier hs-type">elt</span></a></span><span>
</span><span id="line-185"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803250"><span class="hs-identifier hs-type">elt</span></a></span><span>
</span><span id="line-186"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803249"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803250"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-187"></span><span id="addToUDFM_C_Directly"><span class="annot"><span class="annottext">addToUDFM_C_Directly :: forall elt key.
(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; Unique -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addToUDFM_C_Directly"><span class="hs-identifier hs-var hs-var">addToUDFM_C_Directly</span></a></span></span><span> </span><span id="local-6989586621680802667"><span class="annot"><span class="annottext">elt -&gt; elt -&gt; elt
</span><a href="#local-6989586621680802667"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802666"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802666"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802665"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802665"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802664"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802664"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621680802663"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802663"><span class="hs-identifier hs-var">v</span></a></span></span><span>
</span><span id="line-188"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; TaggedVal elt -&gt; TaggedVal elt)
-&gt; Int
-&gt; TaggedVal elt
-&gt; IntMap (TaggedVal elt)
-&gt; IntMap (TaggedVal elt)
forall a. (a -&gt; a -&gt; a) -&gt; Int -&gt; a -&gt; IntMap a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#insertWith"><span class="hs-identifier hs-var">M.insertWith</span></a></span><span> </span><span class="annot"><span class="annottext">TaggedVal elt -&gt; TaggedVal elt -&gt; TaggedVal elt
</span><a href="#local-6989586621680802662"><span class="hs-identifier hs-var">tf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; Int
</span><a href="GHC.Types.Unique.html#getKey"><span class="hs-identifier hs-var">getKey</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802664"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">elt -&gt; Int -&gt; TaggedVal elt
forall val. val -&gt; Int -&gt; TaggedVal val
</span><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-var">TaggedVal</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802663"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802665"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802666"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802665"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-190"></span><span>      </span><span id="local-6989586621680802662"><span class="annot"><span class="annottext">tf :: TaggedVal elt -&gt; TaggedVal elt -&gt; TaggedVal elt
</span><a href="#local-6989586621680802662"><span class="hs-identifier hs-var hs-var">tf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span id="local-6989586621680802661"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802661"><span class="hs-identifier hs-var">new_v</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span id="local-6989586621680802660"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802660"><span class="hs-identifier hs-var">old_v</span></a></span></span><span> </span><span id="local-6989586621680802659"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802659"><span class="hs-identifier hs-var">old_i</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">elt -&gt; Int -&gt; TaggedVal elt
forall val. val -&gt; Int -&gt; TaggedVal val
</span><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-var">TaggedVal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">elt -&gt; elt -&gt; elt
</span><a href="#local-6989586621680802667"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802660"><span class="hs-identifier hs-var">old_v</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802661"><span class="hs-identifier hs-var">new_v</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802659"><span class="hs-identifier hs-var">old_i</span></a></span><span>
</span><span id="line-192"></span><span>          </span><span class="hs-comment">-- Flip the arguments, because M.insertWith uses  (new-&gt;old-&gt;result)</span><span>
</span><span id="line-193"></span><span>          </span><span class="hs-comment">--                         but f            needs (old-&gt;new-&gt;result)</span><span>
</span><span id="line-194"></span><span>          </span><span class="hs-comment">-- Like addToUDFM_Directly, keep the old tag</span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span id="local-6989586621680803245"><span id="local-6989586621680803246"><span class="annot"><a href="GHC.Types.Unique.DFM.html#addToUDFM_C"><span class="hs-identifier hs-type">addToUDFM_C</span></a></span><span>
</span><span id="line-197"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803246"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803245"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803245"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803245"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- old -&gt; new -&gt; result</span><span>
</span><span id="line-198"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803246"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803245"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-comment">-- old</span><span>
</span><span id="line-199"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803246"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803245"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-comment">-- new</span><span>
</span><span id="line-200"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803246"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803245"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span> </span><span class="hs-comment">-- result</span><span>
</span><span id="line-201"></span><span id="addToUDFM_C"><span class="annot"><span class="annottext">addToUDFM_C :: forall key elt.
Uniquable key =&gt;
(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; key -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addToUDFM_C"><span class="hs-identifier hs-var hs-var">addToUDFM_C</span></a></span></span><span> </span><span id="local-6989586621680802656"><span class="annot"><span class="annottext">elt -&gt; elt -&gt; elt
</span><a href="#local-6989586621680802656"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680802655"><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802655"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802654"><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802654"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621680802653"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802653"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; Unique -&gt; elt -&gt; UniqDFM key elt
forall elt key.
(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; Unique -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addToUDFM_C_Directly"><span class="hs-identifier hs-var">addToUDFM_C_Directly</span></a></span><span> </span><span class="annot"><span class="annottext">elt -&gt; elt -&gt; elt
</span><a href="#local-6989586621680802656"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802655"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">key -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802654"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802653"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span id="local-6989586621680803241"><span id="local-6989586621680803242"><span class="annot"><a href="GHC.Types.Unique.DFM.html#addListToUDFM"><span class="hs-identifier hs-type">addListToUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803242"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803242"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803241"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803242"><span class="hs-identifier hs-type">key</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621680803241"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803242"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803241"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-204"></span><span id="addListToUDFM"><span class="annot"><span class="annottext">addListToUDFM :: forall key elt.
Uniquable key =&gt;
UniqDFM key elt -&gt; [(key, elt)] -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addListToUDFM"><span class="hs-identifier hs-var hs-var">addListToUDFM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(UniqDFM key elt -&gt; (key, elt) -&gt; UniqDFM key elt)
-&gt; UniqDFM key elt -&gt; [(key, elt)] -&gt; UniqDFM key elt
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680802647"><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802647"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680802646"><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802646"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680802645"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802645"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt -&gt; key -&gt; elt -&gt; UniqDFM key elt
forall key elt.
Uniquable key =&gt;
UniqDFM key elt -&gt; key -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addToUDFM"><span class="hs-identifier hs-var">addToUDFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802647"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802646"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802645"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-205"></span><span>
</span><span id="line-206"></span><span id="local-6989586621680803237"><span id="local-6989586621680803238"><span class="annot"><a href="GHC.Types.Unique.DFM.html#addListToUDFM_Directly"><span class="hs-identifier hs-type">addListToUDFM_Directly</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803238"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803237"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621680803237"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803238"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803237"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-207"></span><span id="addListToUDFM_Directly"><span class="annot"><span class="annottext">addListToUDFM_Directly :: forall key elt.
UniqDFM key elt -&gt; [(Unique, elt)] -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addListToUDFM_Directly"><span class="hs-identifier hs-var hs-var">addListToUDFM_Directly</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(UniqDFM key elt -&gt; (Unique, elt) -&gt; UniqDFM key elt)
-&gt; UniqDFM key elt -&gt; [(Unique, elt)] -&gt; UniqDFM key elt
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680802642"><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802642"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680802641"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802641"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680802640"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802640"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt -&gt; Unique -&gt; elt -&gt; UniqDFM key elt
forall key elt. UniqDFM key elt -&gt; Unique -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addToUDFM_Directly"><span class="hs-identifier hs-var">addToUDFM_Directly</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802642"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802641"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802640"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span id="local-6989586621680803233"><span id="local-6989586621680803234"><span class="annot"><a href="GHC.Types.Unique.DFM.html#addListToUDFM_Directly_C"><span class="hs-identifier hs-type">addListToUDFM_Directly_C</span></a></span><span>
</span><span id="line-210"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803234"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803234"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803234"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803233"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803234"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621680803234"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803233"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803234"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-211"></span><span id="addListToUDFM_Directly_C"><span class="annot"><span class="annottext">addListToUDFM_Directly_C :: forall elt key.
(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; [(Unique, elt)] -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addListToUDFM_Directly_C"><span class="hs-identifier hs-var hs-var">addListToUDFM_Directly_C</span></a></span></span><span> </span><span id="local-6989586621680802637"><span class="annot"><span class="annottext">elt -&gt; elt -&gt; elt
</span><a href="#local-6989586621680802637"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(UniqDFM key elt -&gt; (Unique, elt) -&gt; UniqDFM key elt)
-&gt; UniqDFM key elt -&gt; [(Unique, elt)] -&gt; UniqDFM key elt
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680802636"><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802636"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680802635"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802635"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680802634"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802634"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; Unique -&gt; elt -&gt; UniqDFM key elt
forall elt key.
(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; Unique -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addToUDFM_C_Directly"><span class="hs-identifier hs-var">addToUDFM_C_Directly</span></a></span><span> </span><span class="annot"><span class="annottext">elt -&gt; elt -&gt; elt
</span><a href="#local-6989586621680802637"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802636"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802635"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802634"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-212"></span><span>
</span><span id="line-213"></span><span id="local-6989586621680803229"><span id="local-6989586621680803230"><span class="annot"><a href="GHC.Types.Unique.DFM.html#delFromUDFM"><span class="hs-identifier hs-type">delFromUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803230"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803230"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803229"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803230"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803230"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803229"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-214"></span><span id="delFromUDFM"><span class="annot"><span class="annottext">delFromUDFM :: forall key elt.
Uniquable key =&gt;
UniqDFM key elt -&gt; key -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#delFromUDFM"><span class="hs-identifier hs-var hs-var">delFromUDFM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802631"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802631"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802630"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802630"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802629"><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802629"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; IntMap (TaggedVal elt) -&gt; IntMap (TaggedVal elt)
forall a. Int -&gt; IntMap a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#delete"><span class="hs-identifier hs-var">M.delete</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; Int
</span><a href="GHC.Types.Unique.html#getKey"><span class="hs-identifier hs-var">getKey</span></a></span><span> </span><span class="annot"><span class="annottext">(Unique -&gt; Int) -&gt; Unique -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">key -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802629"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802631"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802630"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-215"></span><span>
</span><span id="line-216"></span><span id="local-6989586621680803224"><span id="local-6989586621680803225"><span class="annot"><a href="GHC.Types.Unique.DFM.html#plusUDFM_C"><span class="hs-identifier hs-type">plusUDFM_C</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803225"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803225"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803225"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803224"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803225"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803224"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803225"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803224"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803225"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-217"></span><span id="plusUDFM_C"><span class="annot"><span class="annottext">plusUDFM_C :: forall elt key.
(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#plusUDFM_C"><span class="hs-identifier hs-var hs-var">plusUDFM_C</span></a></span></span><span> </span><span id="local-6989586621680802625"><span class="annot"><span class="annottext">elt -&gt; elt -&gt; elt
</span><a href="#local-6989586621680802625"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680802624"><span class="annot"><span class="annottext">udfml :: UniqDFM key elt
</span><a href="#local-6989586621680802624"><span class="hs-identifier hs-var">udfml</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680802623"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802623"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802622"><span class="annot"><span class="annottext">udfmr :: UniqDFM key elt
</span><a href="#local-6989586621680802622"><span class="hs-identifier hs-var">udfmr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680802621"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802621"><span class="hs-identifier hs-var">j</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span>  </span><span class="hs-comment">-- we will use the upper bound on the tag as a proxy for the set size,</span><span>
</span><span id="line-219"></span><span>  </span><span class="hs-comment">-- to insert the smaller one into the bigger one</span><span>
</span><span id="line-220"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802623"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802621"><span class="hs-identifier hs-var">j</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
forall elt key.
(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#insertUDFMIntoLeft_C"><span class="hs-identifier hs-var">insertUDFMIntoLeft_C</span></a></span><span> </span><span class="annot"><span class="annottext">elt -&gt; elt -&gt; elt
</span><a href="#local-6989586621680802625"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802624"><span class="hs-identifier hs-var">udfml</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802622"><span class="hs-identifier hs-var">udfmr</span></a></span><span>
</span><span id="line-221"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
forall elt key.
(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#insertUDFMIntoLeft_C"><span class="hs-identifier hs-var">insertUDFMIntoLeft_C</span></a></span><span> </span><span class="annot"><span class="annottext">elt -&gt; elt -&gt; elt
</span><a href="#local-6989586621680802625"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802622"><span class="hs-identifier hs-var">udfmr</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802624"><span class="hs-identifier hs-var">udfml</span></a></span><span>
</span><span id="line-222"></span><span>
</span><span id="line-223"></span><span class="hs-comment">-- Note [Overflow on plusUDFM]</span><span>
</span><span id="line-224"></span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-225"></span><span class="hs-comment">-- There are multiple ways of implementing plusUDFM.</span><span>
</span><span id="line-226"></span><span class="hs-comment">-- The main problem that needs to be solved is overlap on times of</span><span>
</span><span id="line-227"></span><span class="hs-comment">-- insertion between different keys in two maps.</span><span>
</span><span id="line-228"></span><span class="hs-comment">-- Consider:</span><span>
</span><span id="line-229"></span><span class="hs-comment">--</span><span>
</span><span id="line-230"></span><span class="hs-comment">-- A = fromList [(a, (x, 1))]</span><span>
</span><span id="line-231"></span><span class="hs-comment">-- B = fromList [(b, (y, 1))]</span><span>
</span><span id="line-232"></span><span class="hs-comment">--</span><span>
</span><span id="line-233"></span><span class="hs-comment">-- If you merge them naively you end up with:</span><span>
</span><span id="line-234"></span><span class="hs-comment">--</span><span>
</span><span id="line-235"></span><span class="hs-comment">-- C = fromList [(a, (x, 1)), (b, (y, 1))]</span><span>
</span><span id="line-236"></span><span class="hs-comment">--</span><span>
</span><span id="line-237"></span><span class="hs-comment">-- Which loses information about ordering and brings us back into</span><span>
</span><span id="line-238"></span><span class="hs-comment">-- non-deterministic world.</span><span>
</span><span id="line-239"></span><span class="hs-comment">--</span><span>
</span><span id="line-240"></span><span class="hs-comment">-- The solution I considered before would increment the tags on one of the</span><span>
</span><span id="line-241"></span><span class="hs-comment">-- sets by the upper bound of the other set. The problem with this approach</span><span>
</span><span id="line-242"></span><span class="hs-comment">-- is that you'll run out of tags for some merge patterns.</span><span>
</span><span id="line-243"></span><span class="hs-comment">-- Say you start with A with upper bound 1, you merge A with A to get A' and</span><span>
</span><span id="line-244"></span><span class="hs-comment">-- the upper bound becomes 2. You merge A' with A' and the upper bound</span><span>
</span><span id="line-245"></span><span class="hs-comment">-- doubles again. After 64 merges you overflow.</span><span>
</span><span id="line-246"></span><span class="hs-comment">-- This solution would have the same time complexity as plusUFM, namely O(n+m).</span><span>
</span><span id="line-247"></span><span class="hs-comment">--</span><span>
</span><span id="line-248"></span><span class="hs-comment">-- The solution I ended up with has time complexity of</span><span>
</span><span id="line-249"></span><span class="hs-comment">-- O(m log m + m * min (n+m, W)) where m is the smaller set.</span><span>
</span><span id="line-250"></span><span class="hs-comment">-- It simply inserts the elements of the smaller set into the larger</span><span>
</span><span id="line-251"></span><span class="hs-comment">-- set in the order that they were inserted into the smaller set. That's</span><span>
</span><span id="line-252"></span><span class="hs-comment">-- O(m log m) for extracting the elements from the smaller set in the</span><span>
</span><span id="line-253"></span><span class="hs-comment">-- insertion order and O(m * min(n+m, W)) to insert them into the bigger</span><span>
</span><span id="line-254"></span><span class="hs-comment">-- set.</span><span>
</span><span id="line-255"></span><span>
</span><span id="line-256"></span><span id="local-6989586621680803219"><span id="local-6989586621680803220"><span class="annot"><a href="GHC.Types.Unique.DFM.html#plusUDFM"><span class="hs-identifier hs-type">plusUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803220"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803219"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803220"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803219"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803220"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803219"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-257"></span><span id="plusUDFM"><span class="annot"><span class="annottext">plusUDFM :: forall key elt.
UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#plusUDFM"><span class="hs-identifier hs-var hs-var">plusUDFM</span></a></span></span><span> </span><span id="local-6989586621680802617"><span class="annot"><span class="annottext">udfml :: UniqDFM key elt
</span><a href="#local-6989586621680802617"><span class="hs-identifier hs-var">udfml</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680802616"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802616"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802615"><span class="annot"><span class="annottext">udfmr :: UniqDFM key elt
</span><a href="#local-6989586621680802615"><span class="hs-identifier hs-var">udfmr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680802614"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802614"><span class="hs-identifier hs-var">j</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-258"></span><span>  </span><span class="hs-comment">-- we will use the upper bound on the tag as a proxy for the set size,</span><span>
</span><span id="line-259"></span><span>  </span><span class="hs-comment">-- to insert the smaller one into the bigger one</span><span>
</span><span id="line-260"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802616"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802614"><span class="hs-identifier hs-var">j</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
forall key elt.
UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#insertUDFMIntoLeft"><span class="hs-identifier hs-var">insertUDFMIntoLeft</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802617"><span class="hs-identifier hs-var">udfml</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802615"><span class="hs-identifier hs-var">udfmr</span></a></span><span>
</span><span id="line-261"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
forall key elt.
UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#insertUDFMIntoLeft"><span class="hs-identifier hs-var">insertUDFMIntoLeft</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802615"><span class="hs-identifier hs-var">udfmr</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802617"><span class="hs-identifier hs-var">udfml</span></a></span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span id="local-6989586621680802611"><span id="local-6989586621680802612"><span class="annot"><a href="GHC.Types.Unique.DFM.html#insertUDFMIntoLeft"><span class="hs-identifier hs-type">insertUDFMIntoLeft</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802612"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802611"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802612"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802611"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802612"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802611"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-264"></span><span id="insertUDFMIntoLeft"><span class="annot"><span class="annottext">insertUDFMIntoLeft :: forall key elt.
UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#insertUDFMIntoLeft"><span class="hs-identifier hs-var hs-var">insertUDFMIntoLeft</span></a></span></span><span> </span><span id="local-6989586621680802610"><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802610"><span class="hs-identifier hs-var">udfml</span></a></span></span><span> </span><span id="local-6989586621680802609"><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802609"><span class="hs-identifier hs-var">udfmr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt -&gt; [(Unique, elt)] -&gt; UniqDFM key elt
forall key elt.
UniqDFM key elt -&gt; [(Unique, elt)] -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addListToUDFM_Directly"><span class="hs-identifier hs-var">addListToUDFM_Directly</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802610"><span class="hs-identifier hs-var">udfml</span></a></span><span> </span><span class="annot"><span class="annottext">([(Unique, elt)] -&gt; UniqDFM key elt)
-&gt; [(Unique, elt)] -&gt; UniqDFM key elt
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt -&gt; [(Unique, elt)]
forall key elt. UniqDFM key elt -&gt; [(Unique, elt)]
</span><a href="GHC.Types.Unique.DFM.html#udfmToList"><span class="hs-identifier hs-var">udfmToList</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802609"><span class="hs-identifier hs-var">udfmr</span></a></span><span>
</span><span id="line-265"></span><span>
</span><span id="line-266"></span><span id="local-6989586621680802607"><span id="local-6989586621680802608"><span class="annot"><a href="GHC.Types.Unique.DFM.html#insertUDFMIntoLeft_C"><span class="hs-identifier hs-type">insertUDFMIntoLeft_C</span></a></span><span>
</span><span id="line-267"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680802608"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680802608"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680802608"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802607"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802608"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802607"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802608"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802607"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802608"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-268"></span><span id="insertUDFMIntoLeft_C"><span class="annot"><span class="annottext">insertUDFMIntoLeft_C :: forall elt key.
(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#insertUDFMIntoLeft_C"><span class="hs-identifier hs-var hs-var">insertUDFMIntoLeft_C</span></a></span></span><span> </span><span id="local-6989586621680802606"><span class="annot"><span class="annottext">elt -&gt; elt -&gt; elt
</span><a href="#local-6989586621680802606"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680802605"><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802605"><span class="hs-identifier hs-var">udfml</span></a></span></span><span> </span><span id="local-6989586621680802604"><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802604"><span class="hs-identifier hs-var">udfmr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-269"></span><span>  </span><span class="annot"><span class="annottext">(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; [(Unique, elt)] -&gt; UniqDFM key elt
forall elt key.
(elt -&gt; elt -&gt; elt)
-&gt; UniqDFM key elt -&gt; [(Unique, elt)] -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addListToUDFM_Directly_C"><span class="hs-identifier hs-var">addListToUDFM_Directly_C</span></a></span><span> </span><span class="annot"><span class="annottext">elt -&gt; elt -&gt; elt
</span><a href="#local-6989586621680802606"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802605"><span class="hs-identifier hs-var">udfml</span></a></span><span> </span><span class="annot"><span class="annottext">([(Unique, elt)] -&gt; UniqDFM key elt)
-&gt; [(Unique, elt)] -&gt; UniqDFM key elt
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt -&gt; [(Unique, elt)]
forall key elt. UniqDFM key elt -&gt; [(Unique, elt)]
</span><a href="GHC.Types.Unique.DFM.html#udfmToList"><span class="hs-identifier hs-var">udfmToList</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802604"><span class="hs-identifier hs-var">udfmr</span></a></span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span id="local-6989586621680803211"><span id="local-6989586621680803212"><span class="annot"><a href="GHC.Types.Unique.DFM.html#lookupUDFM"><span class="hs-identifier hs-type">lookupUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803212"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803212"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803211"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803212"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803211"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-272"></span><span id="lookupUDFM"><span class="annot"><span class="annottext">lookupUDFM :: forall key elt.
Uniquable key =&gt;
UniqDFM key elt -&gt; key -&gt; Maybe elt
</span><a href="GHC.Types.Unique.DFM.html#lookupUDFM"><span class="hs-identifier hs-var hs-var">lookupUDFM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802599"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802599"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802598"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802598"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802597"><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802597"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TaggedVal elt -&gt; elt
forall val. TaggedVal val -&gt; val
</span><a href="GHC.Types.Unique.DFM.html#taggedFst"><span class="hs-identifier hs-var">taggedFst</span></a></span><span> </span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; elt) -&gt; Maybe (TaggedVal elt) -&gt; Maybe elt
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; IntMap (TaggedVal elt) -&gt; Maybe (TaggedVal elt)
forall a. Int -&gt; IntMap a -&gt; Maybe a
</span><a href="../../containers/src/Data.IntMap.Internal.html#lookup"><span class="hs-identifier hs-var">M.lookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; Int
</span><a href="GHC.Types.Unique.html#getKey"><span class="hs-identifier hs-var">getKey</span></a></span><span> </span><span class="annot"><span class="annottext">(Unique -&gt; Int) -&gt; Unique -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">key -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802597"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802599"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-273"></span><span>
</span><span id="line-274"></span><span id="local-6989586621680803206"><span id="local-6989586621680803207"><span class="annot"><a href="GHC.Types.Unique.DFM.html#lookupUDFM_Directly"><span class="hs-identifier hs-type">lookupUDFM_Directly</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803207"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803206"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803206"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-275"></span><span id="lookupUDFM_Directly"><span class="annot"><span class="annottext">lookupUDFM_Directly :: forall key elt. UniqDFM key elt -&gt; Unique -&gt; Maybe elt
</span><a href="GHC.Types.Unique.DFM.html#lookupUDFM_Directly"><span class="hs-identifier hs-var hs-var">lookupUDFM_Directly</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802594"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802594"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802593"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802593"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802592"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802592"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TaggedVal elt -&gt; elt
forall val. TaggedVal val -&gt; val
</span><a href="GHC.Types.Unique.DFM.html#taggedFst"><span class="hs-identifier hs-var">taggedFst</span></a></span><span> </span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; elt) -&gt; Maybe (TaggedVal elt) -&gt; Maybe elt
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; IntMap (TaggedVal elt) -&gt; Maybe (TaggedVal elt)
forall a. Int -&gt; IntMap a -&gt; Maybe a
</span><a href="../../containers/src/Data.IntMap.Internal.html#lookup"><span class="hs-identifier hs-var">M.lookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; Int
</span><a href="GHC.Types.Unique.html#getKey"><span class="hs-identifier hs-var">getKey</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802592"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802594"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-276"></span><span>
</span><span id="line-277"></span><span id="local-6989586621680803202"><span id="local-6989586621680803203"><span class="annot"><a href="GHC.Types.Unique.DFM.html#elemUDFM"><span class="hs-identifier hs-type">elemUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803203"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803203"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803203"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803202"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span></span><span>
</span><span id="line-278"></span><span id="elemUDFM"><span class="annot"><span class="annottext">elemUDFM :: forall key elt. Uniquable key =&gt; key -&gt; UniqDFM key elt -&gt; Bool
</span><a href="GHC.Types.Unique.DFM.html#elemUDFM"><span class="hs-identifier hs-var hs-var">elemUDFM</span></a></span></span><span> </span><span id="local-6989586621680802589"><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802589"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802588"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802588"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802587"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802587"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IntMap (TaggedVal elt) -&gt; Bool
forall a. Int -&gt; IntMap a -&gt; Bool
</span><a href="../../containers/src/Data.IntMap.Internal.html#member"><span class="hs-identifier hs-var">M.member</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; Int
</span><a href="GHC.Types.Unique.html#getKey"><span class="hs-identifier hs-var">getKey</span></a></span><span> </span><span class="annot"><span class="annottext">(Unique -&gt; Int) -&gt; Unique -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">key -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802589"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802588"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-279"></span><span>
</span><span id="line-280"></span><span class="hs-comment">-- | Performs a deterministic fold over the UniqDFM.</span><span>
</span><span id="line-281"></span><span class="hs-comment">-- It's O(n log n) while the corresponding function on `UniqFM` is O(n).</span><span>
</span><span id="line-282"></span><span id="local-6989586621680803305"><span id="local-6989586621680803306"><span id="local-6989586621680803307"><span class="annot"><a href="GHC.Types.Unique.DFM.html#foldUDFM"><span class="hs-identifier hs-type">foldUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803307"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803306"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803306"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803306"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803305"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803307"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803306"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-283"></span><span id="foldUDFM"><span class="annot"><span class="annottext">foldUDFM :: forall elt a key. (elt -&gt; a -&gt; a) -&gt; a -&gt; UniqDFM key elt -&gt; a
</span><a href="GHC.Types.Unique.DFM.html#foldUDFM"><span class="hs-identifier hs-var hs-var">foldUDFM</span></a></span></span><span> </span><span id="local-6989586621680802584"><span class="annot"><span class="annottext">elt -&gt; a -&gt; a
</span><a href="#local-6989586621680802584"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621680802583"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680802583"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span id="local-6989586621680802582"><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802582"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(elt -&gt; a -&gt; a) -&gt; a -&gt; [elt] -&gt; a
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">elt -&gt; a -&gt; a
</span><a href="#local-6989586621680802584"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680802583"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqDFM key elt -&gt; [elt]
forall key a. UniqDFM key a -&gt; [a]
</span><a href="GHC.Types.Unique.DFM.html#eltsUDFM"><span class="hs-identifier hs-var">eltsUDFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802582"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span class="hs-comment">-- | Performs a nondeterministic strict fold over the UniqDFM.</span><span>
</span><span id="line-286"></span><span class="hs-comment">-- It's O(n), same as the corresponding function on `UniqFM`.</span><span>
</span><span id="line-287"></span><span class="hs-comment">-- If you use this please provide a justification why it doesn't introduce</span><span>
</span><span id="line-288"></span><span class="hs-comment">-- nondeterminism.</span><span>
</span><span id="line-289"></span><span id="local-6989586621680802579"><span id="local-6989586621680802580"><span id="local-6989586621680802581"><span class="annot"><a href="GHC.Types.Unique.DFM.html#nonDetStrictFoldUDFM"><span class="hs-identifier hs-type">nonDetStrictFoldUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680802581"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680802580"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680802580"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680802580"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802579"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802581"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680802580"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-290"></span><span id="nonDetStrictFoldUDFM"><span class="annot"><span class="annottext">nonDetStrictFoldUDFM :: forall elt a key. (elt -&gt; a -&gt; a) -&gt; a -&gt; UniqDFM key elt -&gt; a
</span><a href="GHC.Types.Unique.DFM.html#nonDetStrictFoldUDFM"><span class="hs-identifier hs-var hs-var">nonDetStrictFoldUDFM</span></a></span></span><span> </span><span id="local-6989586621680802576"><span class="annot"><span class="annottext">elt -&gt; a -&gt; a
</span><a href="#local-6989586621680802576"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621680802575"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680802575"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802574"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802574"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802573"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802573"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; TaggedVal elt -&gt; a) -&gt; a -&gt; IntMap (TaggedVal elt) -&gt; a
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; TaggedVal elt -&gt; a
</span><a href="#local-6989586621680802572"><span class="hs-identifier hs-var">k'</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680802575"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802574"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-291"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-292"></span><span>    </span><span id="local-6989586621680802572"><span class="annot"><span class="annottext">k' :: a -&gt; TaggedVal elt -&gt; a
</span><a href="#local-6989586621680802572"><span class="hs-identifier hs-var hs-var">k'</span></a></span></span><span> </span><span id="local-6989586621680802571"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680802571"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span id="local-6989586621680802570"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802570"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">elt -&gt; a -&gt; a
</span><a href="#local-6989586621680802576"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802570"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680802571"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span id="local-6989586621680802568"><span id="local-6989586621680802569"><span class="annot"><a href="GHC.Types.Unique.DFM.html#eltsUDFM"><span class="hs-identifier hs-type">eltsUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802569"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802568"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621680802568"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-295"></span><span id="eltsUDFM"><span class="annot"><span class="annottext">eltsUDFM :: forall key a. UniqDFM key a -&gt; [a]
</span><a href="GHC.Types.Unique.DFM.html#eltsUDFM"><span class="hs-identifier hs-var hs-var">eltsUDFM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802566"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802566"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802565"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802565"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-296"></span><span>  </span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; elt) -&gt; [TaggedVal elt] -&gt; [elt]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TaggedVal elt -&gt; elt
forall val. TaggedVal val -&gt; val
</span><a href="GHC.Types.Unique.DFM.html#taggedFst"><span class="hs-identifier hs-var">taggedFst</span></a></span><span> </span><span class="annot"><span class="annottext">([TaggedVal elt] -&gt; [elt]) -&gt; [TaggedVal elt] -&gt; [elt]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; TaggedVal elt -&gt; Ordering)
-&gt; [TaggedVal elt] -&gt; [TaggedVal elt]
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#sortBy"><span class="hs-identifier hs-var">sortBy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><span class="hs-identifier hs-var">compare</span></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Int -&gt; Ordering)
-&gt; (TaggedVal elt -&gt; Int)
-&gt; TaggedVal elt
-&gt; TaggedVal elt
-&gt; Ordering
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="../../base/src/Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="annot"><span class="annottext">TaggedVal elt -&gt; Int
forall val. TaggedVal val -&gt; Int
</span><a href="GHC.Types.Unique.DFM.html#taggedSnd"><span class="hs-identifier hs-var">taggedSnd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([TaggedVal elt] -&gt; [TaggedVal elt])
-&gt; [TaggedVal elt] -&gt; [TaggedVal elt]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; [TaggedVal elt]
forall a. IntMap a -&gt; [a]
</span><a href="../../containers/src/Data.IntMap.Internal.html#elems"><span class="hs-identifier hs-var">M.elems</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802566"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-297"></span><span>
</span><span id="line-298"></span><span id="local-6989586621680803182"><span id="local-6989586621680803183"><span class="annot"><a href="GHC.Types.Unique.DFM.html#filterUDFM"><span class="hs-identifier hs-type">filterUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803183"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803182"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803183"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803182"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803183"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-299"></span><span id="filterUDFM"><span class="annot"><span class="annottext">filterUDFM :: forall elt key. (elt -&gt; Bool) -&gt; UniqDFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#filterUDFM"><span class="hs-identifier hs-var hs-var">filterUDFM</span></a></span></span><span> </span><span id="local-6989586621680802562"><span class="annot"><span class="annottext">elt -&gt; Bool
</span><a href="#local-6989586621680802562"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802561"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802561"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802560"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802560"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; Bool)
-&gt; IntMap (TaggedVal elt) -&gt; IntMap (TaggedVal elt)
forall a. (a -&gt; Bool) -&gt; IntMap a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#filter"><span class="hs-identifier hs-var">M.filter</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span id="local-6989586621680802558"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802558"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">elt -&gt; Bool
</span><a href="#local-6989586621680802562"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802558"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802561"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802560"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-300"></span><span>
</span><span id="line-301"></span><span id="local-6989586621680803177"><span id="local-6989586621680803178"><span class="annot"><a href="GHC.Types.Unique.DFM.html#filterUDFM_Directly"><span class="hs-identifier hs-type">filterUDFM_Directly</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803178"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803177"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803178"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803177"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803178"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-302"></span><span id="filterUDFM_Directly"><span class="annot"><span class="annottext">filterUDFM_Directly :: forall elt key.
(Unique -&gt; elt -&gt; Bool) -&gt; UniqDFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#filterUDFM_Directly"><span class="hs-identifier hs-var hs-var">filterUDFM_Directly</span></a></span></span><span> </span><span id="local-6989586621680802555"><span class="annot"><span class="annottext">Unique -&gt; elt -&gt; Bool
</span><a href="#local-6989586621680802555"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802554"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802554"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802553"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802553"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Int -&gt; TaggedVal elt -&gt; Bool)
-&gt; IntMap (TaggedVal elt) -&gt; IntMap (TaggedVal elt)
forall a. (Int -&gt; a -&gt; Bool) -&gt; IntMap a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#filterWithKey"><span class="hs-identifier hs-var">M.filterWithKey</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; TaggedVal elt -&gt; Bool
forall {a}. Uniquable a =&gt; a -&gt; TaggedVal elt -&gt; Bool
</span><a href="#local-6989586621680802551"><span class="hs-identifier hs-var">p'</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802554"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802553"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-303"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-304"></span><span>  </span><span id="local-6989586621680802551"><span class="annot"><span class="annottext">p' :: a -&gt; TaggedVal elt -&gt; Bool
</span><a href="#local-6989586621680802551"><span class="hs-identifier hs-var hs-var">p'</span></a></span></span><span> </span><span id="local-6989586621680802548"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680802548"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span id="local-6989586621680802547"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802547"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; elt -&gt; Bool
</span><a href="#local-6989586621680802555"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680802548"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802547"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-305"></span><span>
</span><span id="line-306"></span><span class="hs-comment">-- | Converts `UniqDFM` to a list, with elements in deterministic order.</span><span>
</span><span id="line-307"></span><span class="hs-comment">-- It's O(n log n) while the corresponding function on `UniqFM` is O(n).</span><span>
</span><span id="line-308"></span><span id="local-6989586621680803278"><span id="local-6989586621680803279"><span class="annot"><a href="GHC.Types.Unique.DFM.html#udfmToList"><span class="hs-identifier hs-type">udfmToList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803279"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803278"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621680803278"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span></span></span><span>
</span><span id="line-309"></span><span id="udfmToList"><span class="annot"><span class="annottext">udfmToList :: forall key elt. UniqDFM key elt -&gt; [(Unique, elt)]
</span><a href="GHC.Types.Unique.DFM.html#udfmToList"><span class="hs-identifier hs-var hs-var">udfmToList</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802544"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802544"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802543"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802543"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-310"></span><span>  </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802542"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TaggedVal elt -&gt; elt
forall val. TaggedVal val -&gt; val
</span><a href="GHC.Types.Unique.DFM.html#taggedFst"><span class="hs-identifier hs-var">taggedFst</span></a></span><span> </span><span class="annot"><span class="annottext">TaggedVal elt
</span><a href="#local-6989586621680802541"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-311"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680802542"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802542"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680802541"><span class="annot"><span class="annottext">TaggedVal elt
</span><a href="#local-6989586621680802541"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((Int, TaggedVal elt) -&gt; (Int, TaggedVal elt) -&gt; Ordering)
-&gt; [(Int, TaggedVal elt)] -&gt; [(Int, TaggedVal elt)]
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#sortBy"><span class="hs-identifier hs-var">sortBy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><span class="hs-identifier hs-var">compare</span></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Int -&gt; Ordering)
-&gt; ((Int, TaggedVal elt) -&gt; Int)
-&gt; (Int, TaggedVal elt)
-&gt; (Int, TaggedVal elt)
-&gt; Ordering
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="../../base/src/Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TaggedVal elt -&gt; Int
forall val. TaggedVal val -&gt; Int
</span><a href="GHC.Types.Unique.DFM.html#taggedSnd"><span class="hs-identifier hs-var">taggedSnd</span></a></span><span> </span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; Int)
-&gt; ((Int, TaggedVal elt) -&gt; TaggedVal elt)
-&gt; (Int, TaggedVal elt)
-&gt; Int
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Int, TaggedVal elt) -&gt; TaggedVal elt
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([(Int, TaggedVal elt)] -&gt; [(Int, TaggedVal elt)])
-&gt; [(Int, TaggedVal elt)] -&gt; [(Int, TaggedVal elt)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; [(Int, TaggedVal elt)]
forall a. IntMap a -&gt; [(Int, a)]
</span><a href="../../containers/src/Data.IntMap.Internal.html#toList"><span class="hs-identifier hs-var">M.toList</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802544"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span class="hs-comment">-- Determines whether two 'UniqDFM's contain the same keys.</span><span>
</span><span id="line-314"></span><span id="local-6989586621680803165"><span id="local-6989586621680803166"><span id="local-6989586621680803167"><span class="annot"><a href="GHC.Types.Unique.DFM.html#equalKeysUDFM"><span class="hs-identifier hs-type">equalKeysUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803167"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803166"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803167"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803165"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span></span></span><span>
</span><span id="line-315"></span><span id="equalKeysUDFM"><span class="annot"><span class="annottext">equalKeysUDFM :: forall key a b. UniqDFM key a -&gt; UniqDFM key b -&gt; Bool
</span><a href="GHC.Types.Unique.DFM.html#equalKeysUDFM"><span class="hs-identifier hs-var hs-var">equalKeysUDFM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802537"><span class="annot"><span class="annottext">IntMap (TaggedVal a)
</span><a href="#local-6989586621680802537"><span class="hs-identifier hs-var">m1</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802536"><span class="annot"><span class="annottext">IntMap (TaggedVal b)
</span><a href="#local-6989586621680802536"><span class="hs-identifier hs-var">m2</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TaggedVal a -&gt; TaggedVal b -&gt; Bool)
-&gt; IntMap (TaggedVal a) -&gt; IntMap (TaggedVal b) -&gt; Bool
forall (f :: * -&gt; *) a b.
Eq1 f =&gt;
(a -&gt; b -&gt; Bool) -&gt; f a -&gt; f b -&gt; Bool
</span><a href="../../base/src/Data.Functor.Classes.html#liftEq"><span class="hs-identifier hs-var">liftEq</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">TaggedVal a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">TaggedVal b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal a)
</span><a href="#local-6989586621680802537"><span class="hs-identifier hs-var">m1</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal b)
</span><a href="#local-6989586621680802536"><span class="hs-identifier hs-var">m2</span></a></span><span>
</span><span id="line-316"></span><span>
</span><span id="line-317"></span><span id="local-6989586621680802533"><span id="local-6989586621680802534"><span class="annot"><a href="GHC.Types.Unique.DFM.html#isNullUDFM"><span class="hs-identifier hs-type">isNullUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802534"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802533"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span></span><span>
</span><span id="line-318"></span><span id="isNullUDFM"><span class="annot"><span class="annottext">isNullUDFM :: forall key a. UniqDFM key a -&gt; Bool
</span><a href="GHC.Types.Unique.DFM.html#isNullUDFM"><span class="hs-identifier hs-var hs-var">isNullUDFM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802532"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802532"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Bool
forall a. IntMap a -&gt; Bool
</span><a href="../../containers/src/Data.IntMap.Internal.html#null"><span class="hs-identifier hs-var">M.null</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802532"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span id="local-6989586621680802529"><span id="local-6989586621680802530"><span class="annot"><a href="GHC.Types.Unique.DFM.html#sizeUDFM"><span class="hs-identifier hs-type">sizeUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802530"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802529"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span></span></span><span>
</span><span id="line-321"></span><span id="sizeUDFM"><span class="annot"><span class="annottext">sizeUDFM :: forall key a. UniqDFM key a -&gt; Int
</span><a href="GHC.Types.Unique.DFM.html#sizeUDFM"><span class="hs-identifier hs-var hs-var">sizeUDFM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802528"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802528"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802527"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802527"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int
forall a. IntMap a -&gt; Int
</span><a href="../../containers/src/Data.IntMap.Internal.html#size"><span class="hs-identifier hs-var">M.size</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802528"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-322"></span><span>
</span><span id="line-323"></span><span id="local-6989586621680802524"><span id="local-6989586621680802525"><span class="annot"><a href="GHC.Types.Unique.DFM.html#intersectUDFM"><span class="hs-identifier hs-type">intersectUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802525"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802524"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802525"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802524"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802525"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802524"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-324"></span><span id="intersectUDFM"><span class="annot"><span class="annottext">intersectUDFM :: forall key elt.
UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#intersectUDFM"><span class="hs-identifier hs-var hs-var">intersectUDFM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802523"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802523"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680802522"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802522"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802521"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802521"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621680802520"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802520"><span class="hs-identifier hs-var">_j</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
-&gt; IntMap (TaggedVal elt) -&gt; IntMap (TaggedVal elt)
forall a b. IntMap a -&gt; IntMap b -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#intersection"><span class="hs-identifier hs-var">M.intersection</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802523"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802521"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802522"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-325"></span><span>  </span><span class="hs-comment">-- M.intersection is left biased, that means the result will only have</span><span>
</span><span id="line-326"></span><span>  </span><span class="hs-comment">-- a subset of elements from the left set, so `i` is a good upper bound.</span><span>
</span><span id="line-327"></span><span>
</span><span id="line-328"></span><span id="local-6989586621680803145"><span id="local-6989586621680803146"><span id="local-6989586621680803147"><span class="annot"><a href="GHC.Types.Unique.DFM.html#udfmIntersectUFM"><span class="hs-identifier hs-type">udfmIntersectUFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803147"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803146"><span class="hs-identifier hs-type">elt1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier hs-type">UniqFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803147"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803145"><span class="hs-identifier hs-type">elt2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803147"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803146"><span class="hs-identifier hs-type">elt1</span></a></span></span></span></span><span>
</span><span id="line-329"></span><span id="udfmIntersectUFM"><span class="annot"><span class="annottext">udfmIntersectUFM :: forall key elt1 elt2.
UniqDFM key elt1 -&gt; UniqFM key elt2 -&gt; UniqDFM key elt1
</span><a href="GHC.Types.Unique.DFM.html#udfmIntersectUFM"><span class="hs-identifier hs-var hs-var">udfmIntersectUFM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802518"><span class="annot"><span class="annottext">IntMap (TaggedVal elt1)
</span><a href="#local-6989586621680802518"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680802517"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802517"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802516"><span class="annot"><span class="annottext">UniqFM key elt2
</span><a href="#local-6989586621680802516"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt1) -&gt; Int -&gt; UniqDFM key elt1
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntMap (TaggedVal elt1) -&gt; IntMap elt2 -&gt; IntMap (TaggedVal elt1)
forall a b. IntMap a -&gt; IntMap b -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#intersection"><span class="hs-identifier hs-var">M.intersection</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt1)
</span><a href="#local-6989586621680802518"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqFM key elt2 -&gt; IntMap elt2
forall key elt. UniqFM key elt -&gt; IntMap elt
</span><a href="GHC.Types.Unique.FM.html#ufmToIntMap"><span class="hs-identifier hs-var">ufmToIntMap</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM key elt2
</span><a href="#local-6989586621680802516"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802517"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-330"></span><span>  </span><span class="hs-comment">-- M.intersection is left biased, that means the result will only have</span><span>
</span><span id="line-331"></span><span>  </span><span class="hs-comment">-- a subset of elements from the left set, so `i` is a good upper bound.</span><span>
</span><span id="line-332"></span><span>
</span><span id="line-333"></span><span id="local-6989586621680803137"><span id="local-6989586621680803138"><span class="annot"><a href="GHC.Types.Unique.DFM.html#disjointUDFM"><span class="hs-identifier hs-type">disjointUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803138"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803137"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803138"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803137"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span></span><span>
</span><span id="line-334"></span><span id="disjointUDFM"><span class="annot"><span class="annottext">disjointUDFM :: forall key elt. UniqDFM key elt -&gt; UniqDFM key elt -&gt; Bool
</span><a href="GHC.Types.Unique.DFM.html#disjointUDFM"><span class="hs-identifier hs-var hs-var">disjointUDFM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802515"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802515"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680802514"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802514"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802513"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802513"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621680802512"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802512"><span class="hs-identifier hs-var">_j</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; IntMap (TaggedVal elt) -&gt; Bool
forall a b. IntMap a -&gt; IntMap b -&gt; Bool
</span><a href="../../containers/src/Data.IntMap.Internal.html#disjoint"><span class="hs-identifier hs-var">M.disjoint</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802515"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802513"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-335"></span><span>
</span><span id="line-336"></span><span id="local-6989586621680803130"><span id="local-6989586621680803131"><span id="local-6989586621680803132"><span class="annot"><a href="GHC.Types.Unique.DFM.html#disjointUdfmUfm"><span class="hs-identifier hs-type">disjointUdfmUfm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803132"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803131"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier hs-type">UniqFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803132"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803130"><span class="hs-identifier hs-type">elt2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span></span></span><span>
</span><span id="line-337"></span><span id="disjointUdfmUfm"><span class="annot"><span class="annottext">disjointUdfmUfm :: forall key elt elt2. UniqDFM key elt -&gt; UniqFM key elt2 -&gt; Bool
</span><a href="GHC.Types.Unique.DFM.html#disjointUdfmUfm"><span class="hs-identifier hs-var hs-var">disjointUdfmUfm</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802510"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802510"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680802509"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802509"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802508"><span class="annot"><span class="annottext">UniqFM key elt2
</span><a href="#local-6989586621680802508"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; IntMap elt2 -&gt; Bool
forall a b. IntMap a -&gt; IntMap b -&gt; Bool
</span><a href="../../containers/src/Data.IntMap.Internal.html#disjoint"><span class="hs-identifier hs-var">M.disjoint</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802510"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqFM key elt2 -&gt; IntMap elt2
forall key elt. UniqFM key elt -&gt; IntMap elt
</span><a href="GHC.Types.Unique.FM.html#ufmToIntMap"><span class="hs-identifier hs-var">ufmToIntMap</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM key elt2
</span><a href="#local-6989586621680802508"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-338"></span><span>
</span><span id="line-339"></span><span id="local-6989586621680803124"><span id="local-6989586621680803125"><span id="local-6989586621680803126"><span class="annot"><a href="GHC.Types.Unique.DFM.html#minusUDFM"><span class="hs-identifier hs-type">minusUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803126"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803125"><span class="hs-identifier hs-type">elt1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803126"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803124"><span class="hs-identifier hs-type">elt2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803126"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803125"><span class="hs-identifier hs-type">elt1</span></a></span></span></span></span><span>
</span><span id="line-340"></span><span id="minusUDFM"><span class="annot"><span class="annottext">minusUDFM :: forall key elt1 elt2.
UniqDFM key elt1 -&gt; UniqDFM key elt2 -&gt; UniqDFM key elt1
</span><a href="GHC.Types.Unique.DFM.html#minusUDFM"><span class="hs-identifier hs-var hs-var">minusUDFM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802507"><span class="annot"><span class="annottext">IntMap (TaggedVal elt1)
</span><a href="#local-6989586621680802507"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680802506"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802506"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802505"><span class="annot"><span class="annottext">IntMap (TaggedVal elt2)
</span><a href="#local-6989586621680802505"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621680802504"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802504"><span class="hs-identifier hs-var">_j</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt1) -&gt; Int -&gt; UniqDFM key elt1
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntMap (TaggedVal elt1)
-&gt; IntMap (TaggedVal elt2) -&gt; IntMap (TaggedVal elt1)
forall a b. IntMap a -&gt; IntMap b -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#difference"><span class="hs-identifier hs-var">M.difference</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt1)
</span><a href="#local-6989586621680802507"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt2)
</span><a href="#local-6989586621680802505"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802506"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-341"></span><span>  </span><span class="hs-comment">-- M.difference returns a subset of a left set, so `i` is a good upper</span><span>
</span><span id="line-342"></span><span>  </span><span class="hs-comment">-- bound.</span><span>
</span><span id="line-343"></span><span>
</span><span id="line-344"></span><span id="local-6989586621680802500"><span id="local-6989586621680802501"><span id="local-6989586621680802502"><span class="annot"><a href="GHC.Types.Unique.DFM.html#udfmMinusUFM"><span class="hs-identifier hs-type">udfmMinusUFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802502"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802501"><span class="hs-identifier hs-type">elt1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier hs-type">UniqFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802502"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802500"><span class="hs-identifier hs-type">elt2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802502"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802501"><span class="hs-identifier hs-type">elt1</span></a></span></span></span></span><span>
</span><span id="line-345"></span><span id="udfmMinusUFM"><span class="annot"><span class="annottext">udfmMinusUFM :: forall key elt1 elt2.
UniqDFM key elt1 -&gt; UniqFM key elt2 -&gt; UniqDFM key elt1
</span><a href="GHC.Types.Unique.DFM.html#udfmMinusUFM"><span class="hs-identifier hs-var hs-var">udfmMinusUFM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802499"><span class="annot"><span class="annottext">IntMap (TaggedVal elt1)
</span><a href="#local-6989586621680802499"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680802498"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802498"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802497"><span class="annot"><span class="annottext">UniqFM key elt2
</span><a href="#local-6989586621680802497"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt1) -&gt; Int -&gt; UniqDFM key elt1
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntMap (TaggedVal elt1) -&gt; IntMap elt2 -&gt; IntMap (TaggedVal elt1)
forall a b. IntMap a -&gt; IntMap b -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#difference"><span class="hs-identifier hs-var">M.difference</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt1)
</span><a href="#local-6989586621680802499"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqFM key elt2 -&gt; IntMap elt2
forall key elt. UniqFM key elt -&gt; IntMap elt
</span><a href="GHC.Types.Unique.FM.html#ufmToIntMap"><span class="hs-identifier hs-var">ufmToIntMap</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM key elt2
</span><a href="#local-6989586621680802497"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802498"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-346"></span><span>  </span><span class="hs-comment">-- M.difference returns a subset of a left set, so `i` is a good upper</span><span>
</span><span id="line-347"></span><span>  </span><span class="hs-comment">-- bound.</span><span>
</span><span id="line-348"></span><span>
</span><span id="line-349"></span><span id="local-6989586621680803115"><span id="local-6989586621680803116"><span id="local-6989586621680803117"><span class="annot"><a href="GHC.Types.Unique.DFM.html#ufmMinusUDFM"><span class="hs-identifier hs-type">ufmMinusUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier hs-type">UniqFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803117"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803116"><span class="hs-identifier hs-type">elt1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803117"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803115"><span class="hs-identifier hs-type">elt2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier hs-type">UniqFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803117"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803116"><span class="hs-identifier hs-type">elt1</span></a></span></span></span></span><span>
</span><span id="line-350"></span><span id="ufmMinusUDFM"><span class="annot"><span class="annottext">ufmMinusUDFM :: forall key elt1 elt2.
UniqFM key elt1 -&gt; UniqDFM key elt2 -&gt; UniqFM key elt1
</span><a href="GHC.Types.Unique.DFM.html#ufmMinusUDFM"><span class="hs-identifier hs-var hs-var">ufmMinusUDFM</span></a></span></span><span> </span><span id="local-6989586621680802496"><span class="annot"><span class="annottext">UniqFM key elt1
</span><a href="#local-6989586621680802496"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802495"><span class="annot"><span class="annottext">IntMap (TaggedVal elt2)
</span><a href="#local-6989586621680802495"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621680802494"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802494"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap elt1 -&gt; UniqFM key elt1
forall elt key. IntMap elt -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#unsafeIntMapToUFM"><span class="hs-identifier hs-var">unsafeIntMapToUFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntMap elt1 -&gt; IntMap (TaggedVal elt2) -&gt; IntMap elt1
forall a b. IntMap a -&gt; IntMap b -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#difference"><span class="hs-identifier hs-var">M.difference</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqFM key elt1 -&gt; IntMap elt1
forall key elt. UniqFM key elt -&gt; IntMap elt
</span><a href="GHC.Types.Unique.FM.html#ufmToIntMap"><span class="hs-identifier hs-var">ufmToIntMap</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM key elt1
</span><a href="#local-6989586621680802496"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt2)
</span><a href="#local-6989586621680802495"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-351"></span><span>
</span><span id="line-352"></span><span class="hs-comment">-- | Partition UniqDFM into two UniqDFMs according to the predicate</span><span>
</span><span id="line-353"></span><span id="local-6989586621680803108"><span id="local-6989586621680803109"><span class="annot"><a href="GHC.Types.Unique.DFM.html#partitionUDFM"><span class="hs-identifier hs-type">partitionUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803109"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803108"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803109"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803108"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803109"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803108"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803109"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-354"></span><span id="partitionUDFM"><span class="annot"><span class="annottext">partitionUDFM :: forall elt key.
(elt -&gt; Bool)
-&gt; UniqDFM key elt -&gt; (UniqDFM key elt, UniqDFM key elt)
</span><a href="GHC.Types.Unique.DFM.html#partitionUDFM"><span class="hs-identifier hs-var hs-var">partitionUDFM</span></a></span></span><span> </span><span id="local-6989586621680802493"><span class="annot"><span class="annottext">elt -&gt; Bool
</span><a href="#local-6989586621680802493"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802492"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802492"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802491"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802491"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-355"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; Bool)
-&gt; IntMap (TaggedVal elt)
-&gt; (IntMap (TaggedVal elt), IntMap (TaggedVal elt))
forall a. (a -&gt; Bool) -&gt; IntMap a -&gt; (IntMap a, IntMap a)
</span><a href="../../containers/src/Data.IntMap.Internal.html#partition"><span class="hs-identifier hs-var">M.partition</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">elt -&gt; Bool
</span><a href="#local-6989586621680802493"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">(elt -&gt; Bool) -&gt; (TaggedVal elt -&gt; elt) -&gt; TaggedVal elt -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TaggedVal elt -&gt; elt
forall val. TaggedVal val -&gt; val
</span><a href="GHC.Types.Unique.DFM.html#taggedFst"><span class="hs-identifier hs-var">taggedFst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802492"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-356"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621680802489"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802489"><span class="hs-identifier hs-var">left</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680802488"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802488"><span class="hs-identifier hs-var">right</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802489"><span class="hs-identifier hs-var">left</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802491"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802488"><span class="hs-identifier hs-var">right</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802491"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span class="hs-comment">-- | Delete a list of elements from a UniqDFM</span><span>
</span><span id="line-359"></span><span id="local-6989586621680803103"><span id="local-6989586621680803104"><span class="annot"><a href="GHC.Types.Unique.DFM.html#delListFromUDFM"><span class="hs-identifier hs-type">delListFromUDFM</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803104"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803104"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803103"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621680803104"><span class="hs-identifier hs-type">key</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803104"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803103"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-360"></span><span id="delListFromUDFM"><span class="annot"><span class="annottext">delListFromUDFM :: forall key elt.
Uniquable key =&gt;
UniqDFM key elt -&gt; [key] -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#delListFromUDFM"><span class="hs-identifier hs-var hs-var">delListFromUDFM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(UniqDFM key elt -&gt; key -&gt; UniqDFM key elt)
-&gt; UniqDFM key elt -&gt; [key] -&gt; UniqDFM key elt
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt -&gt; key -&gt; UniqDFM key elt
forall key elt.
Uniquable key =&gt;
UniqDFM key elt -&gt; key -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#delFromUDFM"><span class="hs-identifier hs-var">delFromUDFM</span></a></span><span>
</span><span id="line-361"></span><span>
</span><span id="line-362"></span><span class="hs-comment">-- | This allows for lossy conversion from UniqDFM to UniqFM</span><span>
</span><span id="line-363"></span><span id="local-6989586621680803099"><span id="local-6989586621680803100"><span class="annot"><a href="GHC.Types.Unique.DFM.html#udfmToUfm"><span class="hs-identifier hs-type">udfmToUfm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803100"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803099"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier hs-type">UniqFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803100"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803099"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-364"></span><span id="udfmToUfm"><span class="annot"><span class="annottext">udfmToUfm :: forall key elt. UniqDFM key elt -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.DFM.html#udfmToUfm"><span class="hs-identifier hs-var hs-var">udfmToUfm</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802484"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802484"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802483"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802483"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap elt -&gt; UniqFM key elt
forall elt key. IntMap elt -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#unsafeIntMapToUFM"><span class="hs-identifier hs-var">unsafeIntMapToUFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; elt) -&gt; IntMap (TaggedVal elt) -&gt; IntMap elt
forall a b. (a -&gt; b) -&gt; IntMap a -&gt; IntMap b
</span><a href="../../containers/src/Data.IntMap.Internal.html#map"><span class="hs-identifier hs-var">M.map</span></a></span><span> </span><span class="annot"><span class="annottext">TaggedVal elt -&gt; elt
forall val. TaggedVal val -&gt; val
</span><a href="GHC.Types.Unique.DFM.html#taggedFst"><span class="hs-identifier hs-var">taggedFst</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802484"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-365"></span><span>
</span><span id="line-366"></span><span id="local-6989586621680803093"><span id="local-6989586621680803094"><span class="annot"><a href="GHC.Types.Unique.DFM.html#listToUDFM"><span class="hs-identifier hs-type">listToUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803094"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803094"><span class="hs-identifier hs-type">key</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621680803093"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803094"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803093"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-367"></span><span id="listToUDFM"><span class="annot"><span class="annottext">listToUDFM :: forall key elt. Uniquable key =&gt; [(key, elt)] -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#listToUDFM"><span class="hs-identifier hs-var hs-var">listToUDFM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(UniqDFM key elt -&gt; (key, elt) -&gt; UniqDFM key elt)
-&gt; UniqDFM key elt -&gt; [(key, elt)] -&gt; UniqDFM key elt
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680802478"><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802478"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680802477"><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802477"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680802476"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802476"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt -&gt; key -&gt; elt -&gt; UniqDFM key elt
forall key elt.
Uniquable key =&gt;
UniqDFM key elt -&gt; key -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addToUDFM"><span class="hs-identifier hs-var">addToUDFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802478"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802477"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802476"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
forall key elt. UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#emptyUDFM"><span class="hs-identifier hs-var">emptyUDFM</span></a></span><span>
</span><span id="line-368"></span><span>
</span><span id="line-369"></span><span id="local-6989586621680803286"><span id="local-6989586621680803287"><span class="annot"><a href="GHC.Types.Unique.DFM.html#listToUDFM_Directly"><span class="hs-identifier hs-type">listToUDFM_Directly</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621680803287"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803286"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803287"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-370"></span><span id="listToUDFM_Directly"><span class="annot"><span class="annottext">listToUDFM_Directly :: forall elt key. [(Unique, elt)] -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#listToUDFM_Directly"><span class="hs-identifier hs-var hs-var">listToUDFM_Directly</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(UniqDFM key elt -&gt; (Unique, elt) -&gt; UniqDFM key elt)
-&gt; UniqDFM key elt -&gt; [(Unique, elt)] -&gt; UniqDFM key elt
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680802474"><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802474"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680802473"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802473"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680802472"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802472"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt -&gt; Unique -&gt; elt -&gt; UniqDFM key elt
forall key elt. UniqDFM key elt -&gt; Unique -&gt; elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#addToUDFM_Directly"><span class="hs-identifier hs-var">addToUDFM_Directly</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
</span><a href="#local-6989586621680802474"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802473"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802472"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">UniqDFM key elt
forall key elt. UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#emptyUDFM"><span class="hs-identifier hs-var">emptyUDFM</span></a></span><span>
</span><span id="line-371"></span><span>
</span><span id="line-372"></span><span class="hs-comment">-- | Apply a function to a particular element</span><span>
</span><span id="line-373"></span><span id="local-6989586621680803087"><span id="local-6989586621680803088"><span class="annot"><a href="GHC.Types.Unique.DFM.html#adjustUDFM"><span class="hs-identifier hs-type">adjustUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803088"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803087"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803087"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803088"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803087"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803088"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803088"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803087"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-374"></span><span id="adjustUDFM"><span class="annot"><span class="annottext">adjustUDFM :: forall key elt.
Uniquable key =&gt;
(elt -&gt; elt) -&gt; UniqDFM key elt -&gt; key -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#adjustUDFM"><span class="hs-identifier hs-var hs-var">adjustUDFM</span></a></span></span><span> </span><span id="local-6989586621680802468"><span class="annot"><span class="annottext">elt -&gt; elt
</span><a href="#local-6989586621680802468"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802467"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802467"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802466"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802466"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802465"><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802465"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; TaggedVal elt)
-&gt; Int -&gt; IntMap (TaggedVal elt) -&gt; IntMap (TaggedVal elt)
forall a. (a -&gt; a) -&gt; Int -&gt; IntMap a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#adjust"><span class="hs-identifier hs-var">M.adjust</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(elt -&gt; elt) -&gt; TaggedVal elt -&gt; TaggedVal elt
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">elt -&gt; elt
</span><a href="#local-6989586621680802468"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; Int
</span><a href="GHC.Types.Unique.html#getKey"><span class="hs-identifier hs-var">getKey</span></a></span><span> </span><span class="annot"><span class="annottext">(Unique -&gt; Int) -&gt; Unique -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">key -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802465"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802467"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802466"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-375"></span><span>
</span><span id="line-376"></span><span class="hs-comment">-- | Apply a function to a particular element</span><span>
</span><span id="line-377"></span><span id="local-6989586621680803082"><span id="local-6989586621680803083"><span class="annot"><a href="GHC.Types.Unique.DFM.html#adjustUDFM_Directly"><span class="hs-identifier hs-type">adjustUDFM_Directly</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803083"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803083"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803082"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803083"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803082"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803083"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-378"></span><span id="adjustUDFM_Directly"><span class="annot"><span class="annottext">adjustUDFM_Directly :: forall elt key.
(elt -&gt; elt) -&gt; UniqDFM key elt -&gt; Unique -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#adjustUDFM_Directly"><span class="hs-identifier hs-var hs-var">adjustUDFM_Directly</span></a></span></span><span> </span><span id="local-6989586621680802462"><span class="annot"><span class="annottext">elt -&gt; elt
</span><a href="#local-6989586621680802462"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802461"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802461"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802460"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802460"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802459"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802459"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; TaggedVal elt)
-&gt; Int -&gt; IntMap (TaggedVal elt) -&gt; IntMap (TaggedVal elt)
forall a. (a -&gt; a) -&gt; Int -&gt; IntMap a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#adjust"><span class="hs-identifier hs-var">M.adjust</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(elt -&gt; elt) -&gt; TaggedVal elt -&gt; TaggedVal elt
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">elt -&gt; elt
</span><a href="#local-6989586621680802462"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; Int
</span><a href="GHC.Types.Unique.html#getKey"><span class="hs-identifier hs-var">getKey</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802459"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802461"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802460"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-379"></span><span>
</span><span id="line-380"></span><span class="hs-comment">-- | The expression (alterUDFM f k map) alters value x at k, or absence</span><span>
</span><span id="line-381"></span><span class="hs-comment">-- thereof. alterUDFM can be used to insert, delete, or update a value in</span><span>
</span><span id="line-382"></span><span class="hs-comment">-- UniqDFM. Use addToUDFM, delFromUDFM or adjustUDFM when possible, they are</span><span>
</span><span id="line-383"></span><span class="hs-comment">-- more efficient.</span><span>
</span><span id="line-384"></span><span id="local-6989586621680803078"><span id="local-6989586621680803079"><span class="annot"><a href="GHC.Types.Unique.DFM.html#alterUDFM"><span class="hs-identifier hs-type">alterUDFM</span></a></span><span>
</span><span id="line-385"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803079"><span class="hs-identifier hs-type">key</span></a></span><span>
</span><span id="line-386"></span><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803078"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803078"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- How to adjust</span><span>
</span><span id="line-387"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803079"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803078"><span class="hs-identifier hs-type">elt</span></a></span><span>               </span><span class="hs-comment">-- old</span><span>
</span><span id="line-388"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803079"><span class="hs-identifier hs-type">key</span></a></span><span>                       </span><span class="hs-comment">-- new</span><span>
</span><span id="line-389"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803079"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803078"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>               </span><span class="hs-comment">-- result</span><span>
</span><span id="line-390"></span><span id="alterUDFM"><span class="annot"><span class="annottext">alterUDFM :: forall key elt.
Uniquable key =&gt;
(Maybe elt -&gt; Maybe elt)
-&gt; UniqDFM key elt -&gt; key -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#alterUDFM"><span class="hs-identifier hs-var hs-var">alterUDFM</span></a></span></span><span> </span><span id="local-6989586621680802454"><span class="annot"><span class="annottext">Maybe elt -&gt; Maybe elt
</span><a href="#local-6989586621680802454"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802453"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802453"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802452"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802452"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680802451"><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802451"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-391"></span><span>  </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt) -&gt; Int -&gt; UniqDFM key elt
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Maybe (TaggedVal elt) -&gt; Maybe (TaggedVal elt))
-&gt; Int -&gt; IntMap (TaggedVal elt) -&gt; IntMap (TaggedVal elt)
forall a. (Maybe a -&gt; Maybe a) -&gt; Int -&gt; IntMap a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#alter"><span class="hs-identifier hs-var">M.alter</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (TaggedVal elt) -&gt; Maybe (TaggedVal elt)
</span><a href="#local-6989586621680802449"><span class="hs-identifier hs-var">alterf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; Int
</span><a href="GHC.Types.Unique.html#getKey"><span class="hs-identifier hs-var">getKey</span></a></span><span> </span><span class="annot"><span class="annottext">(Unique -&gt; Int) -&gt; Unique -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">key -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">key
</span><a href="#local-6989586621680802451"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802453"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802452"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-392"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-393"></span><span>  </span><span id="local-6989586621680802449"><span class="annot"><span class="annottext">alterf :: Maybe (TaggedVal elt) -&gt; Maybe (TaggedVal elt)
</span><a href="#local-6989586621680802449"><span class="hs-identifier hs-var hs-var">alterf</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe (TaggedVal elt)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe elt -&gt; Maybe (TaggedVal elt)
forall {val}. Maybe val -&gt; Maybe (TaggedVal val)
</span><a href="#local-6989586621680802448"><span class="hs-identifier hs-var">inject</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe elt -&gt; Maybe (TaggedVal elt))
-&gt; Maybe elt -&gt; Maybe (TaggedVal elt)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe elt -&gt; Maybe elt
</span><a href="#local-6989586621680802454"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe elt
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-394"></span><span>  </span><span class="annot"><a href="#local-6989586621680802449"><span class="hs-identifier hs-var">alterf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-type">TaggedVal</span></a></span><span> </span><span id="local-6989586621680802447"><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802447"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe elt -&gt; Maybe (TaggedVal elt)
forall {val}. Maybe val -&gt; Maybe (TaggedVal val)
</span><a href="#local-6989586621680802448"><span class="hs-identifier hs-var">inject</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe elt -&gt; Maybe (TaggedVal elt))
-&gt; Maybe elt -&gt; Maybe (TaggedVal elt)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe elt -&gt; Maybe elt
</span><a href="#local-6989586621680802454"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">elt -&gt; Maybe elt
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">elt
</span><a href="#local-6989586621680802447"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-395"></span><span>  </span><span id="local-6989586621680802448"><span class="annot"><span class="annottext">inject :: Maybe val -&gt; Maybe (TaggedVal val)
</span><a href="#local-6989586621680802448"><span class="hs-identifier hs-var hs-var">inject</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe val
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (TaggedVal val)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-396"></span><span>  </span><span class="annot"><a href="#local-6989586621680802448"><span class="hs-identifier hs-var">inject</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680802446"><span class="annot"><span class="annottext">val
</span><a href="#local-6989586621680802446"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TaggedVal val -&gt; Maybe (TaggedVal val)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(TaggedVal val -&gt; Maybe (TaggedVal val))
-&gt; TaggedVal val -&gt; Maybe (TaggedVal val)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">val -&gt; Int -&gt; TaggedVal val
forall val. val -&gt; Int -&gt; TaggedVal val
</span><a href="GHC.Types.Unique.DFM.html#TaggedVal"><span class="hs-identifier hs-var">TaggedVal</span></a></span><span> </span><span class="annot"><span class="annottext">val
</span><a href="#local-6989586621680802446"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802452"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-397"></span><span>
</span><span id="line-398"></span><span class="hs-comment">-- | Map a function over every value in a UniqDFM</span><span>
</span><span id="line-399"></span><span id="local-6989586621680803070"><span id="local-6989586621680803071"><span id="local-6989586621680803072"><span class="annot"><a href="GHC.Types.Unique.DFM.html#mapUDFM"><span class="hs-identifier hs-type">mapUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803072"><span class="hs-identifier hs-type">elt1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680803071"><span class="hs-identifier hs-type">elt2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803070"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803072"><span class="hs-identifier hs-type">elt1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803070"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803071"><span class="hs-identifier hs-type">elt2</span></a></span></span></span></span><span>
</span><span id="line-400"></span><span id="mapUDFM"><span class="annot"><span class="annottext">mapUDFM :: forall elt1 elt2 key.
(elt1 -&gt; elt2) -&gt; UniqDFM key elt1 -&gt; UniqDFM key elt2
</span><a href="GHC.Types.Unique.DFM.html#mapUDFM"><span class="hs-identifier hs-var hs-var">mapUDFM</span></a></span></span><span> </span><span id="local-6989586621680802444"><span class="annot"><span class="annottext">elt1 -&gt; elt2
</span><a href="#local-6989586621680802444"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802443"><span class="annot"><span class="annottext">IntMap (TaggedVal elt1)
</span><a href="#local-6989586621680802443"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802442"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802442"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt2) -&gt; Int -&gt; UniqDFM key elt2
forall key ele. IntMap (TaggedVal ele) -&gt; Int -&gt; UniqDFM key ele
</span><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-var">UDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TaggedVal elt1 -&gt; TaggedVal elt2)
-&gt; IntMap (TaggedVal elt1) -&gt; IntMap (TaggedVal elt2)
forall a b. (a -&gt; b) -&gt; IntMap a -&gt; IntMap b
</span><a href="../../containers/src/Data.IntMap.Internal.html#map"><span class="hs-identifier hs-var">M.map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(elt1 -&gt; elt2) -&gt; TaggedVal elt1 -&gt; TaggedVal elt2
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">elt1 -&gt; elt2
</span><a href="#local-6989586621680802444"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt1)
</span><a href="#local-6989586621680802443"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802442"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-401"></span><span>
</span><span id="line-402"></span><span id="local-6989586621680803065"><span id="local-6989586621680803066"><span class="annot"><a href="GHC.Types.Unique.DFM.html#anyUDFM"><span class="hs-identifier hs-type">anyUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803066"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803065"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803066"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span></span><span>
</span><span id="line-403"></span><span id="anyUDFM"><span class="annot"><span class="annottext">anyUDFM :: forall elt key. (elt -&gt; Bool) -&gt; UniqDFM key elt -&gt; Bool
</span><a href="GHC.Types.Unique.DFM.html#anyUDFM"><span class="hs-identifier hs-var hs-var">anyUDFM</span></a></span></span><span> </span><span id="local-6989586621680802441"><span class="annot"><span class="annottext">elt -&gt; Bool
</span><a href="#local-6989586621680802441"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802440"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802440"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802439"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802439"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; Bool -&gt; Bool)
-&gt; Bool -&gt; IntMap (TaggedVal elt) -&gt; Bool
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; IntMap a -&gt; b
</span><a href="../../containers/src/Data.IntMap.Internal.html#foldr"><span class="hs-identifier hs-var">M.foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">(||)</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool -&gt; Bool)
-&gt; (TaggedVal elt -&gt; Bool) -&gt; TaggedVal elt -&gt; Bool -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">elt -&gt; Bool
</span><a href="#local-6989586621680802441"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">(elt -&gt; Bool) -&gt; (TaggedVal elt -&gt; elt) -&gt; TaggedVal elt -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TaggedVal elt -&gt; elt
forall val. TaggedVal val -&gt; val
</span><a href="GHC.Types.Unique.DFM.html#taggedFst"><span class="hs-identifier hs-var">taggedFst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802440"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-404"></span><span>
</span><span id="line-405"></span><span id="local-6989586621680802435"><span id="local-6989586621680802436"><span class="annot"><a href="GHC.Types.Unique.DFM.html#allUDFM"><span class="hs-identifier hs-type">allUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680802436"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802435"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680802436"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span></span><span>
</span><span id="line-406"></span><span id="allUDFM"><span class="annot"><span class="annottext">allUDFM :: forall elt key. (elt -&gt; Bool) -&gt; UniqDFM key elt -&gt; Bool
</span><a href="GHC.Types.Unique.DFM.html#allUDFM"><span class="hs-identifier hs-var hs-var">allUDFM</span></a></span></span><span> </span><span id="local-6989586621680802434"><span class="annot"><span class="annottext">elt -&gt; Bool
</span><a href="#local-6989586621680802434"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UDFM"><span class="hs-identifier hs-type">UDFM</span></a></span><span> </span><span id="local-6989586621680802433"><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802433"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680802432"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680802432"><span class="hs-identifier hs-var">_i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TaggedVal elt -&gt; Bool -&gt; Bool)
-&gt; Bool -&gt; IntMap (TaggedVal elt) -&gt; Bool
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; IntMap a -&gt; b
</span><a href="../../containers/src/Data.IntMap.Internal.html#foldr"><span class="hs-identifier hs-var">M.foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">(&amp;&amp;)</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool -&gt; Bool)
-&gt; (TaggedVal elt -&gt; Bool) -&gt; TaggedVal elt -&gt; Bool -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">elt -&gt; Bool
</span><a href="#local-6989586621680802434"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">(elt -&gt; Bool) -&gt; (TaggedVal elt -&gt; elt) -&gt; TaggedVal elt -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TaggedVal elt -&gt; elt
forall val. TaggedVal val -&gt; val
</span><a href="GHC.Types.Unique.DFM.html#taggedFst"><span class="hs-identifier hs-var">taggedFst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="annot"><span class="annottext">IntMap (TaggedVal elt)
</span><a href="#local-6989586621680802433"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-407"></span><span>
</span><span id="line-408"></span><span id="local-6989586621680803054"><span id="local-6989586621680803055"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680802426"><span id="local-6989586621680802428"><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semi.Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803055"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803054"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-409"></span><span>  </span><span id="local-6989586621680802424"><span class="annot"><span class="annottext">&lt;&gt; :: UniqDFM key a -&gt; UniqDFM key a -&gt; UniqDFM key a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqDFM key a -&gt; UniqDFM key a -&gt; UniqDFM key a
forall key elt.
UniqDFM key elt -&gt; UniqDFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#plusUDFM"><span class="hs-identifier hs-var">plusUDFM</span></a></span></span></span><span>
</span><span id="line-410"></span><span>
</span><span id="line-411"></span><span id="local-6989586621680803051"><span id="local-6989586621680803052"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680802418"><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803052"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803051"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-412"></span><span>  </span><span id="local-6989586621680802416"><span class="annot"><span class="annottext">mempty :: UniqDFM key a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqDFM key a
forall key elt. UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#emptyUDFM"><span class="hs-identifier hs-var">emptyUDFM</span></a></span><span>
</span><span id="line-413"></span><span>  </span><span id="local-6989586621680802414"><span class="annot"><span class="annottext">mappend :: UniqDFM key a -&gt; UniqDFM key a -&gt; UniqDFM key a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var hs-var hs-var hs-var">mappend</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqDFM key a -&gt; UniqDFM key a -&gt; UniqDFM key a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">(Semi.&lt;&gt;)</span></a></span></span></span><span>
</span><span id="line-414"></span><span>
</span><span id="line-415"></span><span class="hs-comment">-- This should not be used in committed code, provided for convenience to</span><span>
</span><span id="line-416"></span><span class="hs-comment">-- make ad-hoc conversions when developing</span><span>
</span><span id="line-417"></span><span id="local-6989586621680803049"><span id="local-6989586621680803050"><span class="annot"><a href="GHC.Types.Unique.DFM.html#alwaysUnsafeUfmToUdfm"><span class="hs-identifier hs-type">alwaysUnsafeUfmToUdfm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier hs-type">UniqFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803050"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803049"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803050"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803049"><span class="hs-identifier hs-type">elt</span></a></span></span></span><span>
</span><span id="line-418"></span><span id="alwaysUnsafeUfmToUdfm"><span class="annot"><span class="annottext">alwaysUnsafeUfmToUdfm :: forall key elt. UniqFM key elt -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#alwaysUnsafeUfmToUdfm"><span class="hs-identifier hs-var hs-var">alwaysUnsafeUfmToUdfm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Unique, elt)] -&gt; UniqDFM key elt
forall elt key. [(Unique, elt)] -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#listToUDFM_Directly"><span class="hs-identifier hs-var">listToUDFM_Directly</span></a></span><span> </span><span class="annot"><span class="annottext">([(Unique, elt)] -&gt; UniqDFM key elt)
-&gt; (UniqFM key elt -&gt; [(Unique, elt)])
-&gt; UniqFM key elt
-&gt; UniqDFM key elt
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM key elt -&gt; [(Unique, elt)]
forall key elt. UniqFM key elt -&gt; [(Unique, elt)]
</span><a href="GHC.Types.Unique.FM.html#nonDetUFMToList"><span class="hs-identifier hs-var">nonDetUFMToList</span></a></span><span>
</span><span id="line-419"></span><span>
</span><span id="line-420"></span><span class="hs-comment">-- | Cast the key domain of a UniqFM.</span><span>
</span><span id="line-421"></span><span class="hs-comment">--</span><span>
</span><span id="line-422"></span><span class="hs-comment">-- As long as the domains don't overlap in their uniques</span><span>
</span><span id="line-423"></span><span class="hs-comment">-- this is safe.</span><span>
</span><span id="line-424"></span><span id="local-6989586621680803042"><span id="local-6989586621680803043"><span id="local-6989586621680803044"><span class="annot"><a href="GHC.Types.Unique.DFM.html#unsafeCastUDFMKey"><span class="hs-identifier hs-type">unsafeCastUDFMKey</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803044"><span class="hs-identifier hs-type">key1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803043"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803042"><span class="hs-identifier hs-type">key2</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803043"><span class="hs-identifier hs-type">elt</span></a></span></span></span></span><span>
</span><span id="line-425"></span><span id="unsafeCastUDFMKey"><span class="annot"><span class="annottext">unsafeCastUDFMKey :: forall key1 elt key2. UniqDFM key1 elt -&gt; UniqDFM key2 elt
</span><a href="GHC.Types.Unique.DFM.html#unsafeCastUDFMKey"><span class="hs-identifier hs-var hs-var">unsafeCastUDFMKey</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqDFM key1 elt -&gt; UniqDFM key2 elt
forall a b. a -&gt; b
</span><a href="../../base/src/Unsafe.Coerce.html#unsafeCoerce"><span class="hs-identifier hs-var">unsafeCoerce</span></a></span><span> </span><span class="hs-comment">-- Only phantom parameter changes so</span><span>
</span><span id="line-426"></span><span>                                 </span><span class="hs-comment">-- this is safe and avoids reallocation.</span><span>
</span><span id="line-427"></span><span>
</span><span id="line-428"></span><span class="hs-comment">-- Output-ery</span><span>
</span><span id="line-429"></span><span>
</span><span id="line-430"></span><span id="local-6989586621680803033"><span id="local-6989586621680803034"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680802410"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803034"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803033"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803034"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-431"></span><span>    </span><span id="local-6989586621680802407"><span class="annot"><span class="annottext">ppr :: UniqDFM key a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span id="local-6989586621680802405"><span class="annot"><span class="annottext">UniqDFM key a
</span><a href="#local-6989586621680802405"><span class="hs-identifier hs-var">ufm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; SDoc) -&gt; UniqDFM key a -&gt; SDoc
forall a key. (a -&gt; SDoc) -&gt; UniqDFM key a -&gt; SDoc
</span><a href="GHC.Types.Unique.DFM.html#pprUniqDFM"><span class="hs-identifier hs-var">pprUniqDFM</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key a
</span><a href="#local-6989586621680802405"><span class="hs-identifier hs-var">ufm</span></a></span></span></span><span>
</span><span id="line-432"></span><span>
</span><span id="line-433"></span><span id="local-6989586621680803031"><span id="local-6989586621680803032"><span class="annot"><a href="GHC.Types.Unique.DFM.html#pprUniqDFM"><span class="hs-identifier hs-type">pprUniqDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680803032"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803031"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803032"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span></span><span>
</span><span id="line-434"></span><span id="pprUniqDFM"><span class="annot"><span class="annottext">pprUniqDFM :: forall a key. (a -&gt; SDoc) -&gt; UniqDFM key a -&gt; SDoc
</span><a href="GHC.Types.Unique.DFM.html#pprUniqDFM"><span class="hs-identifier hs-var hs-var">pprUniqDFM</span></a></span></span><span> </span><span id="local-6989586621680802402"><span class="annot"><span class="annottext">a -&gt; SDoc
</span><a href="#local-6989586621680802402"><span class="hs-identifier hs-var">ppr_elt</span></a></span></span><span> </span><span id="local-6989586621680802401"><span class="annot"><span class="annottext">UniqDFM key a
</span><a href="#local-6989586621680802401"><span class="hs-identifier hs-var">ufm</span></a></span></span><span>
</span><span id="line-435"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; [SDoc] -&gt; [SDoc]
</span><a href="GHC.Utils.Outputable.html#punctuate"><span class="hs-identifier hs-var">punctuate</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; [SDoc]) -&gt; [SDoc] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-436"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802396"><span class="hs-identifier hs-var">uq</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;:-&gt;&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; SDoc
</span><a href="#local-6989586621680802402"><span class="hs-identifier hs-var">ppr_elt</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680802393"><span class="hs-identifier hs-var">elt</span></a></span><span>
</span><span id="line-437"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680802396"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680802396"><span class="hs-identifier hs-var">uq</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680802393"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680802393"><span class="hs-identifier hs-var">elt</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UniqDFM key a -&gt; [(Unique, a)]
forall key elt. UniqDFM key elt -&gt; [(Unique, elt)]
</span><a href="GHC.Types.Unique.DFM.html#udfmToList"><span class="hs-identifier hs-var">udfmToList</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key a
</span><a href="#local-6989586621680802401"><span class="hs-identifier hs-var">ufm</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-438"></span><span>
</span><span id="line-439"></span><span id="local-6989586621680803027"><span id="local-6989586621680803028"><span class="annot"><a href="GHC.Types.Unique.DFM.html#pprUDFM"><span class="hs-identifier hs-type">pprUDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html#UniqDFM"><span class="hs-identifier hs-type">UniqDFM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803028"><span class="hs-identifier hs-type">key</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680803027"><span class="hs-identifier hs-type">a</span></a></span><span>    </span><span class="hs-comment">-- ^ The things to be pretty printed</span><span>
</span><span id="line-440"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621680803027"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ The pretty printing function to use on the elements</span><span>
</span><span id="line-441"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span></span><span>          </span><span class="hs-comment">-- ^ 'SDoc' where the things have been pretty</span><span>
</span><span id="line-442"></span><span>                        </span><span class="hs-comment">-- printed</span><span>
</span><span id="line-443"></span><span id="pprUDFM"><span class="annot"><span class="annottext">pprUDFM :: forall key a. UniqDFM key a -&gt; ([a] -&gt; SDoc) -&gt; SDoc
</span><a href="GHC.Types.Unique.DFM.html#pprUDFM"><span class="hs-identifier hs-var hs-var">pprUDFM</span></a></span></span><span> </span><span id="local-6989586621680802392"><span class="annot"><span class="annottext">UniqDFM key a
</span><a href="#local-6989586621680802392"><span class="hs-identifier hs-var">ufm</span></a></span></span><span> </span><span id="local-6989586621680802391"><span class="annot"><span class="annottext">[a] -&gt; SDoc
</span><a href="#local-6989586621680802391"><span class="hs-identifier hs-var">pp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; SDoc
</span><a href="#local-6989586621680802391"><span class="hs-identifier hs-var">pp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqDFM key a -&gt; [a]
forall key a. UniqDFM key a -&gt; [a]
</span><a href="GHC.Types.Unique.DFM.html#eltsUDFM"><span class="hs-identifier hs-var">eltsUDFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM key a
</span><a href="#local-6989586621680802392"><span class="hs-identifier hs-var">ufm</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-444"></span></pre></body></html>